Skip to content

Commit

Permalink
Optimise RewriteRules/Conds
Browse files Browse the repository at this point in the history
From upstream changes on Mezzio Skeleton.

Closes shlinkio#1369.
  • Loading branch information
Roy-Orbison authored and acelaya committed Feb 10, 2022
1 parent 5267c4e commit 57eb29c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions public/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^ - [NC,L]

# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
RewriteCond $0::%{REQUEST_URI} ^([^:]*+(?::[^:]*+)*?)::(/.+?)\1$
RewriteRule .+ - [E=BASE:%2]
RewriteRule .* %{ENV:BASE}index.php [NC,L]

0 comments on commit 57eb29c

Please sign in to comment.