Here is what I am trying to do: http://olddomain.com ---------> http://newdomain.com/page1.html http://olddomain.com/page1.html ---------> http://newdomain.com/another-page.html http://olddomain.com/page2.html ---------> http://newdomain.com/some-page.html http://olddomain.com/page3.html ---------> http://newdomain.com/new-page.html Just want a simple 301 redirect solution. thanks Rep+ for answering
Put this on olddomain.com .htaccess RewriteEngine On RewriteRule ^$ http://newdomain.com/page1.html [R=301,L] RewriteRule ^page1\.html$ http://newdomain.com/another-page.html [R=301,L] RewriteRule ^page2\.html$ http://newdomain.com/some-page.html [R=301,L] RewriteRule ^page3\.html$ http://newdomain.com/new-page.html [R=301,L] Code (markup):
thanks mwasif! Another quick question: if my olddomain pages are olddomain.com/page-one/ then would the following be correct? RewriteRule ^page-one\$ http://newdomain.com/another-page.html [R=301,L] thanks for your help
This will work for both olddomain.com/page-one and olddomain.com/page-one/ (note the difference of trailing slash) RewriteRule ^page-one/?$ http://newdomain.com/another-page.html [R=301,L]