.htaccess 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Check that your Apache virtualhost have this settings:
  2. #<Directory "/var/www/chamilo-classic">
  3. # AllowOverride All
  4. # Order allow,deny
  5. # Allow from all
  6. #</Directory>
  7. RewriteEngine on
  8. # http://my.chamilo.net/certificates/?id=123 to http://my.chamilo.net/certificates/index.php?id=123
  9. RewriteCond %{QUERY_STRING} ^id=(.*)$
  10. RewriteRule ^certificates/$ certificates/index.php?id=%1 [L]
  11. # Course redirection
  12. RewriteRule ^courses/([^/]+)/?$ main/course_home/course_home.php?cDir=$1 [QSA,L]
  13. RewriteRule ^courses/([^/]+)/index.php$ main/course_home/course_home.php?cDir=$1 [QSA,L]
  14. # Rewrite everything in the scorm folder of a course to the download script
  15. RewriteRule ^courses/([^/]+)/scorm/(.*)$ main/document/download_scorm.php?doc_url=/$2&cDir=$1 [QSA,L]
  16. # Rewrite everything in the document folder of a course to the download script
  17. # Except certificate resources, which might need to be accessible publicly to all
  18. RewriteRule ^courses/([^/]+)/document/certificates/(.*)$ app/courses/$1/document/certificates/$2 [QSA,L]
  19. RewriteRule ^courses/([^/]+)/document/(.*)$ main/document/download.php?doc_url=/$2&cDir=$1 [QSA,L]
  20. # Course upload files
  21. RewriteRule ^courses/([^/]+)/upload/([^/]+)/(.*)$ main/document/download_uploaded_files.php?code=$1&type=$2&file=$3 [QSA,L]
  22. # Rewrite everything in the work folder
  23. RewriteRule ^courses/([^/]+)/work/(.*)$ main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
  24. RewriteRule ^courses/([^/]+)/course-pic85x85.png$ main/inc/ajax/course.ajax.php?a=get_course_image&code=$1&image=course_image_source [QSA,L]
  25. RewriteRule ^courses/([^/]+)/course-pic.png$ main/inc/ajax/course.ajax.php?a=get_course_image&code=$1&image=course_image_large_source [QSA,L]
  26. # Redirect all courses/ to app/courses/
  27. RewriteRule ^courses/([^/]+)/(.*)$ app/courses/$1/$2 [QSA,L]
  28. # About session
  29. RewriteRule ^session/(\d{1,})/about/?$ main/session/about.php?session_id=$1 [L]
  30. # Issued individual badge friendly URL
  31. RewriteRule ^badge/(\d{1,}) main/badge/issued.php?issue=$1 [L]
  32. # Issued badges friendly URL
  33. RewriteRule ^skill/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
  34. # Support deprecated URL (avoid 404)
  35. RewriteRule ^badge/(\d{1,})/user/(\d{1,}) main/badge/issued_all.php?skill=$1&user=$2 [L]
  36. # Support old URLs using the exercice (with a c) folder rather than exercise
  37. RewriteRule ^main/exercice/(.*)$ main/exercise/$1 [QSA,L]
  38. # Support old URLs using the newscorm folder rather than lp
  39. RewriteRule ^main/newscorm/(.*)$ main/lp/$1 [QSA,L]
  40. # service Information
  41. RewriteRule ^service/(\d{1,})$ plugin/buycourses/src/service_information.php?service_id=$1 [L]
  42. # This rule is very generic and should always remain at the bottom of .htaccess
  43. # http://my.chamilo.net/jdoe to http://my.chamilo.net/user.php?jdoe
  44. RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
  45. # Deny access
  46. RewriteRule ^(tests|.git) - [F,L,NC]
  47. # Add caching of woff font files to avoid loading 2*15KB each time with Chamilo
  48. # default OpenSans font
  49. AddType application/font-woff .woff .woff2
  50. <IfModule mod_expires.c>
  51. ExpiresActive On
  52. ExpiresByType application/font-woff "access plus 1 month"
  53. </IfModule>