Forum Moderators: phranque
I need to redirect all links from old domain to new domain
and making the old domain as a subdomain in the new domain
for example:
mysite.com/forum1
to
mysite.newsite.com/forum1
and the below points must be done:
-Users will automatically be redirected to the new domain - you don't have to inform them.
-search engines will be redirected to the new domain - and all related information will be moved to the new domain.
any suggetions?
Regards
Ayman
A good suggestion would be to try a search [google.com] on WebmasterWorld for a good start.
The resources cited in our Apache Forum Charter [webmasterworld.com], and the threads in our Apache Library [webmasterworld.com] may also prove useful.
Jim
i tried very hard to do it but i didn't find the right way.
this is my topic
[webmasterworld.com...]
i got this code but i think it works in opposite way:
#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite.newdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yoursite.newdomain.com$
RewriteRule (.*)$ [yoursite.com...] [R=301,L]
i need it in opposite way , so shull i do it like this?:
RewriteCond %{HTTP_HOST} ^yournewdomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yournewdomain.com$
RewriteRule (.*)$ [yoursite.newdomain.com...] [R=301,L]
is this right?
please help coze i'm not good in coding
thanking you
But I suppose you could try this, which may do what you want:
# Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} mysite\.com [NC]
RewriteRule ^(.*)$ http://mysite.newsite.com/$1 [R=301,L]
Jim
i will try to explain and sorry for my weak language.
exactly like this:
mysite.com in server1
newsite.net in server2
the site ,files and everything are located in server1
we want only to redirect mysite.com/anything
to
mysite.newsite.net/anything
do I have to make a new subdomain as this "mysite.newsite.net" in server2?
shall i try the code above with this case?
thanking you
Afthl
Since all requests for mysite.com will be redirected to mysite.newsite.net, you can delete all files and folders from server1 (except for the .htaccess file) after copying them to server2 -- No files on server1 will be accessible with this mod_rewrite code in place.
Jim
You will need to configure both servers so that server1 is reverse-proxied to server2. This cannot be done in .htaccess, but will require modification to the server configuration files.
You will have to re-configure server1 to send the requesting IP address to server2, and server2 will have to be modified to log that information instead of the usual Request_Addr.
I suggest that for quickest/best results, you hire a local consultant to do this for you, as otherwise it may take several weeks to get it working.
Jim
[edited by: jdMorgan at 9:08 pm (utc) on Nov. 26, 2009]