.htaccess 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <IfModule mod_rewrite.c>
  2. Options -MultiViews
  3. Options +FollowSymLinks
  4. RewriteEngine On
  5. RewriteBase /
  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. RewriteCond %{REQUEST_URI} !main/newscorm/scorm_api.php
  15. RewriteRule ^main/(.*)\.php web/main/$1.php [R,L]
  16. # Courses documents
  17. # courses/MATHS/document/folder1/picture.jpg --> web/data/courses/MATHS/document/folder1/picture.jpg
  18. RewriteRule ^courses/(.*)/document/(.*)$ web/data/courses/$1/document/$2 [R,L]
  19. # SCORM documents
  20. # courses/MATHS/scorm/folder1/picture.jpg --> web/data/courses/MATHS/scorm/folder1/picture.jpg
  21. RewriteRule ^courses/(.*)/scorm/(.*)$ web/data/courses/$1/scorm/$2 [R,L]
  22. # Certificates
  23. # Redirection: certificates/index.php?id=123 -> web/certificates/123
  24. RewriteCond %{QUERY_STRING} ^id=([0-9]*)
  25. RewriteRule ^certificates/(.*)$ web/certificates/%1? [R,L]
  26. # User profile
  27. # Redirection: user.php?jmontoya -> web/user/jmontoya
  28. RewriteCond %{QUERY_STRING} ^([a-z0-9A-z]*)
  29. RewriteRule ^user.php?$ web/user/%1? [R,L]
  30. # Portal news
  31. # news_list.php?id=5 --> web/news/5
  32. RewriteCond %{QUERY_STRING} ^id=([0-9]*)
  33. RewriteRule ^news_list.php?$ web/news/%1? [R,L]
  34. </IfModule>