Skip to content

Instantly share code, notes, and snippets.

@ashchristopher
Created January 29, 2010 21:20
Show Gist options
  • Save ashchristopher/290150 to your computer and use it in GitHub Desktop.
Save ashchristopher/290150 to your computer and use it in GitHub Desktop.
Dealing with Http/Https issues.
# if we are using port 443 and the url doesnt contain onlinebooking or media-server then redirect to http.
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !(onlinebooking)
RewriteCond %{REQUEST_URI} !(media-server)
RewriteRule ^(.*)$ http://test.gapadventures.com$1 [R=301,L]
# if not using port 443 and url contains onlinebooking, redirect to https
# Redirect to HTTPS server.
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} (onlinebooking)
RewriteRule ^(.*)$ https://test.gapadventures.com$1 [R,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment