htaccess-dist 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <IfModule mod_rewrite.c>
  2. Options -MultiViews
  3. Options +FollowSymLinks
  4. RewriteEngine On
  5. RewriteBase {BASE_URL}
  6. # Courses home
  7. RewriteCond %{QUERY_STRING} ^id_session=0
  8. RewriteRule ^courses/(.*)/(.*)$ web/courses/$1? [R,L]
  9. RewriteCond %{QUERY_STRING} ^id_session=([0-9]*)
  10. RewriteRule ^courses/(.*)/(.*)$ web/courses/$1/%1/? [R,L]
  11. RewriteRule ^courses/(.*)/index.php$ web/courses/$1? [R,L]
  12. RewriteRule ^courses/(.*)/$ web/courses/$1? [R,L]
  13. # PHP Main files are redirected to the "web/main" zone
  14. RewriteRule ^main/(.*)\.php web/main/$1.php [R,L]
  15. # Courses documents
  16. # courses/MATHS/document/folder1/picture.jpg --> web/data/courses/MATHS/document/folder1/picture.jpg
  17. RewriteRule ^courses/(.*)/document/(.*)$ web/data/courses/$1/document/$2 [R,L]
  18. # SCORM documents
  19. # courses/MATHS/scorm/folder1/picture.jpg --> web/data/courses/MATHS/scorm/folder1/picture.jpg
  20. RewriteRule ^courses/(.*)/scorm/(.*)$ web/data/courses/$1/scorm/$2 [R,L]
  21. # Certificates
  22. # Redirection: certificates/index.php?id=123 -> web/certificates/123
  23. RewriteCond %{QUERY_STRING} ^id=([0-9]*)
  24. RewriteRule ^certificates/(.*)$ web/certificates/%1? [R,L]
  25. # Portal news
  26. # news_list.php?id=5 --> web/news/5
  27. RewriteCond %{QUERY_STRING} ^id=([0-9]*)
  28. RewriteRule ^news_list.php?$ web/news/%1? [R,L]
  29. </IfModule>