fatalityhawk
Affiliate Master
- Joined
- Jul 16, 2020
- Messages
- 47
- Likes
- 25
- Degree
- 0
Does anyone know how can I do a page-by-page 301 redirect of a domain to my main domain efficiently? Both websites are WordPress... Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Does anyone know how can I do a page-by-page 301 redirect of a domain to my main domain efficiently? Both websites are WordPress... Thanks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]
</IfModule>
index.html
at the root for good measure.Just want to confirm...Should be only this in the .htaccess of the redirected domain.
Code:<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L] </IfModule>
You can tear it all out, database and all, and just have that in the .htaccess and a blankindex.html
at the root for good measure.
But drop that in the .htaccess first and make sure it works right. I didn't test it. You don't have to take the old version down if you don't want to, in case you ever revert the changes.
olddomain.com > newdomain.com/abc
olddomain.com/def > newdomain.com/def
<IfModule mod_rewrite.c>
RewriteRule ^/def/ https://newdomain.com/def/ [L,R=301]
RewriteRule ^/abc/ https://newdomain.com/abc-123/ [L,R=301]
</IfModule>
Redirect 301 /old-slug/ https://newdomain.com/new-slug/