Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created December 12, 2011 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwenzel/1468482 to your computer and use it in GitHub Desktop.
Save pwenzel/1468482 to your computer and use it in GitHub Desktop.
Conditional SSL Rewrite for Certain Directory Paths
RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !^/facebook_app
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# This lets traffic that isn’t on port 443 (ssl) and isn't at /facebook_app/*
# and redirects it to the same path, but with SSL. This essentially lets stuff in
# /facbeook_app/* slide through over ssl or non-ssl, but nothing else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment