Last active
August 29, 2015 14:23
-
-
Save olimortimer/b283d270a4ecce9d51f8 to your computer and use it in GitHub Desktop.
htaccess snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Force SSL | |
RewriteCond %{HTTPS} !=on [NC] | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# Stop browsing of CDN | |
RewriteCond %{HTTP_HOST} ^cdn\.host\.co\.uk$ [NC] | |
RewriteCond $1 !\.(css|htc|less|js|js2|js3|js4|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|woff|xla|xls|xlsx|xlt|xlw|zip)$ | |
RewriteRule ^(.*)$ https://www.host.co.uk/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment