fixed .htaccess for apache users (#260)

This commit is contained in:
Kevin Papst
2018-08-08 23:35:02 +02:00
committed by GitHub
parent 2f84f3751a
commit 39ea44fdc3

View File

@@ -3,7 +3,7 @@
# mod_rewrite). Additionally, this reduces the matching process for the # mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules # start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex app.php DirectoryIndex index.php
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
@@ -30,7 +30,7 @@ DirectoryIndex app.php
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
# following RewriteCond (best solution) # following RewriteCond (best solution)
RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
# If the requested filename exists, simply serve it. # If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories. # We only want to let Apache serve files and not directories.
@@ -38,7 +38,7 @@ DirectoryIndex app.php
RewriteRule .? - [L] RewriteRule .? - [L]
# Rewrite all other queries to the front controller. # Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/app.php [L] RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule> </IfModule>
<IfModule !mod_rewrite.c> <IfModule !mod_rewrite.c>
@@ -46,7 +46,7 @@ DirectoryIndex app.php
# When mod_rewrite is not available, we instruct a temporary redirect of # When mod_rewrite is not available, we instruct a temporary redirect of
# the start page to the front controller explicitly so that the website # the start page to the front controller explicitly so that the website
# and the generated links can still be used. # and the generated links can still be used.
RedirectMatch 302 ^/$ /app.php/ RedirectMatch 302 ^/$ /index.php/
# RedirectTemp cannot be used instead # RedirectTemp cannot be used instead
</IfModule> </IfModule>
</IfModule> </IfModule>