]> git.openstreetmap.org Git - rails.git/commitdiff
Redirect to canonical hosts.
authorTom Hughes <tom@compton.nu>
Sat, 30 May 2009 11:55:31 +0000 (11:55 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 30 May 2009 11:55:31 +0000 (11:55 +0000)
config/lighttpd.conf

index 22051eb44657c667356d8f50b5e93a4b319407a3..80b941fa6814a98f5dab3d9b72e9804fe3068e65 100644 (file)
@@ -110,6 +110,19 @@ url.redirect = (
   "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
 )
 
   "^/wiki/(.*)$" => "http://wiki.openstreetmap.org/$1"
 )
 
+#
+# Redirect everything except www.openstreetmap.org and
+# api.openstreetmap.org to www.openstreetmap.org
+#
+$HTTP["host"] =~ "^api\." {
+  $HTTP["host"] != "api.openstreetmap.org" {
+    url.redirect = ( "^(.*)$" => "http://api.openstreetmap.org$1" )
+  }
+}
+else $HTTP["host"] != "www.openstreetmap.org" {
+  url.redirect = ( "^(.*)$" => "http://www.openstreetmap.org$1" )
+} 
+
 #
 # Run anything with a .pl iextension as a CGI script
 #
 #
 # Run anything with a .pl iextension as a CGI script
 #