Skip to content

Instantly share code, notes, and snippets.

@kopepasah
Created December 29, 2014 05:52
Show Gist options
  • Save kopepasah/6ab40cae8ab80ac6c908 to your computer and use it in GitHub Desktop.
Save kopepasah/6ab40cae8ab80ac6c908 to your computer and use it in GitHub Desktop.
An .htaccess configuration for redirecting to a subdomain and keeping the path.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://sub.domain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment