Skip to content

Instantly share code, notes, and snippets.

@infoscigeek
Created February 28, 2017 06:51
Show Gist options
  • Save infoscigeek/1f44bc0f97a9c20f5abbff285c5ec1b1 to your computer and use it in GitHub Desktop.
Save infoscigeek/1f44bc0f97a9c20f5abbff285c5ec1b1 to your computer and use it in GitHub Desktop.
Redirect all blog posts and pages to a new domain while retaining structure
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.oldsite.com [NC]
RewriteRule ^(.*)$ http://newsite.com/$1 [L,R=301,NC]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment