-
☆ A M B ☆
- 476 Posts
So I’ve got a client that has a MODx website that is up and running. He now has decided to switch the domain name to a new domain name. The current website has 521 documents. I’m going to transfer the entire site over to the new domain name, but how do we redirect each page from the current site to the corresponding site?
For example:
www.abc123.com/contact-us.html
redirect to:
www.xyz456.com/contact-us.html
All the document aliases will stay the same, just the site URL will change.
Is there a simple script or would it require writing out all the documents in the .htaccess file to redirect (which would take forever) to the new URL for each document?
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 476 Posts
Good deal...thanks so much...I’ll give it a spin.
Precision Web Development ... SmashStack.com
-
☆ A M B ☆
- 476 Posts
Hey bunk58,
I successfully made the change. I modified the code here in the .htaccess file:
# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
#RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# >>> DO NOT USE BOTH THE ABOVE AND BELOW <<<
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.old-domain\.com [NC]
RewriteRule (.*) http://www.new-domain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^old-domain\.com [NC]
RewriteRule (.*) http://www.new-domain.com/$1 [R=301,L]
Thanks for your help!
Precision Web Development ... SmashStack.com