- RedirectPermanent /images/osm_logo.png http://www.openstreetmap.org/assets/osm_logo.png
- RedirectPermanent /images/cc_button.png http://www.openstreetmap.org/assets/cc_button.png
-
- #
- # Define a load balancer for the backends
- #
- <Proxy balancer://backend>
- ProxySet lbmethod=bybusyness
-<% if port == 443 -%>
- BalancerMember https://rails1
- BalancerMember https://rails2
- BalancerMember https://rails3
-<% else -%>
- BalancerMember http://rails1
- BalancerMember http://rails2
- BalancerMember http://rails3
-<% end -%>
- </Proxy>
-<% if port == 80 -%>
-
- #
- # Redirect requests which should be secure to https
- #
- RewriteCond %{REQUEST_URI} ^/login(\.html)?$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/(new|create-account\.html)$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/terms$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/save$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/([^/]+)/account$ [OR]
- RewriteCond %{REQUEST_URI} ^/user/reset-password$
- RewriteRule ^(.*)$ https://www.openstreetmap.org$1 [L,NE,R=permanent]
-
- #
- # Redirect api requests made to www.osm.org to api.osm.org
- #
-# RewriteCond %{HTTP_HOST} =www.openstreetmap.org
-# RewriteRule ^/api/(.*)$ http://api.openstreetmap.org/api/$1 [L,NE,R=permanent]
-
- #
- # Redirect non-api requests made to api.osm.org to www.osm.org
- #
- RewriteCond %{HTTP_HOST} =api.openstreetmap.org
- RewriteCond %{REQUEST_URI} !^/api/
- RewriteRule ^(.*)$ http://www.openstreetmap.org$1 [L,NE,R=permanent]
-<% elsif port == 443 -%>
-
- #
- # Redirect requests which don't work over https to http
- #
- RewriteCond %{REQUEST_URI} ^/edit$
- RewriteRule ^(.*)$ http://www.openstreetmap.org$1 [L,NE,R=permanent]