Skip to content

Instantly share code, notes, and snippets.

@mommaroodles
Created December 11, 2013 10:07
Show Gist options
  • Save mommaroodles/7907950 to your computer and use it in GitHub Desktop.
Save mommaroodles/7907950 to your computer and use it in GitHub Desktop.
Redirect A Folder To A Subdomain
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com$1 [L,R=301]
RedirectMatch 301 ^/blog/(.*)$ http://blog.example.com/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment