Skip to content

Instantly share code, notes, and snippets.

@richerimage
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save richerimage/edb189f747aeff04fd72 to your computer and use it in GitHub Desktop.

Select an option

Save richerimage/edb189f747aeff04fd72 to your computer and use it in GitHub Desktop.
301 redirects
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# BEGIN Permanent URL redirects. NB: 1st one is homepage
RewriteRule ^ http://newdomain/? [L,R=301,NC]
RewriteRule ^blog/ http://newdomain/blog/? [L,R=301,NC]
RewriteRule ^about/ http://newdomain/about/? [L,R=301,NC]
# other 301 rules here
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment