Simplify apache rewrite rules

This commit is contained in:
otbutz 2022-05-20 10:15:28 +02:00 committed by GitHub
parent 4654701c10
commit 22bd9c4993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,22 +163,14 @@ directory like this:
# If format-html is explicity requested, forward to the UI.
RewriteCond %{QUERY_STRING} "format=html"
RewriteRule ^([^/]+).php ui/$1.html [R,END]
# Same but .php suffix is missing.
RewriteCond %{QUERY_STRING} "format=html"
RewriteRule ^([^/]+) ui/$1.html [R,END]
RewriteRule ^([^/]+)(?:.php)? ui/$1.html [R,END]
# If no format parameter is there then forward anything
# but /reverse and /lookup to the UI.
RewriteCond %{QUERY_STRING} "!format="
RewriteCond %{REQUEST_URI} "!/lookup"
RewriteCond %{REQUEST_URI} "!/reverse"
RewriteRule ^([^/]+).php ui/$1.html [R,END]
# Same but .php suffix is missing.
RewriteCond %{QUERY_STRING} "!format="
RewriteCond %{REQUEST_URI} "!/lookup"
RewriteCond %{REQUEST_URI} "!/reverse"
RewriteRule ^([^/]+) ui/$1.html [R,END]
RewriteRule ^([^/]+)(?:.php)? ui/$1.html [R,END]
</Directory>
```