Skip to content

Commit

Permalink
Merge pull request #6364 from vanilla/fix/htaccess
Browse files Browse the repository at this point in the history
Fix .htaccess to work correctly with subdirectory
  • Loading branch information
initvector committed Jan 9, 2018
2 parents 0bc21d5 + 39983d4 commit d4039e2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .htaccess.dist
Expand Up @@ -11,6 +11,9 @@
####
#RewriteBase /

# Make sure that / doesn't try to go to index.php without a rewrite :)
DirectoryIndex disabled

####
# Deny access to certain directories that SHOULD NOT be exposed.
####
Expand All @@ -27,15 +30,14 @@
# You can comment out this section if it causes you problems.
# This is just a nice to have for security purposes.
####
RewriteCond %{REQUEST_URI} !^/index.php$
RewriteRule ^(.+\.php)$ index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
RewriteCond %{REQUEST_URI} !/index.php$
RewriteRule (.+\.php) [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]

####
# Redirect any non existing file/directory to /index.php
####
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]
RewriteRule (.*) index.php [E=X_REWRITE:1,E=X_PATH_INFO:/$1,L]

####
# Add the proper X_REWRITE server variable for rewritten requests.
Expand Down

0 comments on commit d4039e2

Please sign in to comment.