.htaccess 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. DirectoryIndex index.php
  2. <IfModule mod_negotiation.c>
  3. Options -MultiViews
  4. </IfModule>
  5. <IfModule mod_rewrite.c>
  6. RewriteEngine On
  7. RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
  8. RewriteRule .* - [E=BASE:%1]
  9. # Sets the HTTP_AUTHORIZATION header removed by Apache
  10. RewriteCond %{HTTP:Authorization} .+
  11. RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
  12. # Removes the /index.php/ part from a URL, if present
  13. RewriteCond %{ENV:REDIRECT_STATUS} =""
  14. RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
  15. # If the requested filename exists, simply serve it.
  16. # Otherwise rewrite all other queries to the front controller.
  17. RewriteCond %{REQUEST_FILENAME} !-f
  18. RewriteRule ^ %{ENV:BASE}/index.php [L]
  19. </IfModule>
  20. <IfModule !mod_rewrite.c>
  21. <IfModule mod_alias.c>
  22. # When mod_rewrite is not available, we instruct a temporary redirect
  23. # to the front controller explicitly so that the website
  24. RedirectMatch 307 ^/$ /index.php/
  25. </IfModule>
  26. </IfModule>