]> git.openstreetmap.org Git - nominatim.git/commitdiff
Simplify apache rewrite rules
authorotbutz <tbutz@optitool.de>
Fri, 20 May 2022 08:15:28 +0000 (10:15 +0200)
committerGitHub <noreply@github.com>
Fri, 20 May 2022 08:15:28 +0000 (10:15 +0200)
docs/admin/Setup-Nominatim-UI.md

index 374a84e197ccf9032ab8e883e7f303ecdd138c25..02ff7df107d5013a0a98ac4ed5a313b2ced0fd4a 100644 (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>
 ```