Forum Moderators: buckworks & webwork

Message Too Old, No Replies

old domain to new domain redirect

domain redirect

         

heart resale

5:20 am on May 10, 2007 (gmt 0)

10+ Year Member



I read artical and tried to redirect my old domain to new domain. its working fine by creating .htaccess in the root of old domain.

but one of the folder is change in our new domain.
so i am getting error in new domain.

1. is there any change in .htaccess?
2. is it possible that i can redirect pericular folder of my old domain to new domain?

Eg.
Pleae find below folder name changes in old and new domains.
Old domain - olddomain.com/singapore
new domain - newdomain.com/asia/singapore

Looking forward to hear from you soon.

Kind Regards,

----------- your previous article ---------------
If you have mod_rewrite, then you can create a file called .htaccess in your document root and add the following lines:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com
RewriteRule (.*) [new-domain.com...] [R=301,L]

leadegroot

5:40 am on May 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^singapore/(.*) http://www.new-domain.com/asia/singapore/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com
RewriteRule (.*) http://www.new-domain.com/$1 [R=301,L]

ie one line added to check for the special directory before you move the rest of the site
(I haven't specifically tested this code, but the general idea works)

(I had nice line breaks to space out the code, but doing so ended the code block - weird!)