Skip to content

Instantly share code, notes, and snippets.

@Meekohi
Created April 28, 2017 20:56
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 Meekohi/599140e17970aa081de48af5d9a5ce08 to your computer and use it in GitHub Desktop.
Save Meekohi/599140e17970aa081de48af5d9a5ce08 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect all HTTP traffic to HTTPS with a hard 301 redirect
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Redirect www.mountainx.com to mountainx.com [!] changes this to https since we aren't accepting http traffic
RewriteCond %{HTTP_HOST} ^www\.mountainx\.com [NC]
RewriteRule ^(.*)$ https://mountainx.com/$1 [L,R=301]
# [!] Direct SceneThink traffix to HTTPS too so it doesn't try to serve http: content and get extra redirects
RewriteRule ^clubland/(.*)$ https://asheville.scenethink.com/$1?proxy=mountainx.com/clubland&slug=clubland [QSA,L,NC,P]
RewriteRule ^clubland https://asheville.scenethink.com/$1?proxy=mountainx.com/clubland&slug=clubland [QSA,L,NC,P]
RewriteRule ^calendar/(.*)$ https://asheville.scenethink.com/$1?proxy=mountainx.com/calendar&slug=mountainxpress [QSA,L,NC,P]
RewriteRule ^calendar https://asheville.scenethink.com/$1?proxy=mountainx.com/calendar&slug=mountainxpress [QSA,L,NC,P]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment