Created
January 17, 2014 02:05
-
-
Save ZellSnippets/8467276 to your computer and use it in GitHub Desktop.
htaccess: Redirect rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Redirects. | |
http://codegarage.com/blog/2011/03/how-to-301-redirect-your-wordpress-blog-to-a-new-url/ | |
# Test 1 | |
RewriteEngine on | |
RewriteRule ^(.*)$ http://yourcodegarage.com/blog/$1 [R=301,L] | |
# Test 2 | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/$ | |
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L] | |
# Test 3 from WPMU https://premium.wpmudev.org/blog/how-to-301-redirect-wordpress-posts-to-a-new-domain/ | |
# BEGIN WordPress | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www.oldsite.com RewriteRule (.*) | |
http://www.newsite.com/$1 [R=301,L] | |
# END WordPress | |
# Check with http://www.howto301redirect.com/301-redirect-checker/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment