Domain Redirection + Page

Using a single web hosting account to host multiple sites

Domain Redirection + Page

Postby Braddor » Sat Aug 30, 2008 10:37 pm

Ok, so say I have a site at www.sitea.com. Now I use Wordpress so many people will link to specific parts of the site, e.g. www.sitea.com/news/page

Now I have a new domain, www.siteb.com, and i would like when users go to any URL under the www.sitea.com TLD, for it to adjust to www.siteb.com/(respective page/folder)...


so if I went to www.sitea.com/news/page, it should change to www.siteb.com/news/page

what is the mod_rewrite code for this?

Thanks
Braddor
 
Posts: 3
Joined: Sat Aug 30, 2008 10:24 pm

Postby richardk » Sun Aug 31, 2008 8:44 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example-a\.com$ [NC]
RewriteRule .* http://www.example-b.com%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Braddor » Sun Aug 31, 2008 8:52 am

Ok, now it actually works for real pages, which I am glad to see but it doesn't redirect Wordpress generated URLs... any idea what I could do or should I take my query to the WP forums?
Braddor
 
Posts: 3
Joined: Sat Aug 30, 2008 10:24 pm

Postby richardk » Sun Aug 31, 2008 8:58 am

Do you have Wordpress mod_rewrite? Put this mod_rewrite first.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Braddor » Sun Aug 31, 2008 9:07 am

richardk wrote:Do you have Wordpress mod_rewrite? Put this mod_rewrite first.


yes it worked...you are my hero :D ..thanks
Braddor
 
Posts: 3
Joined: Sat Aug 30, 2008 10:24 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 4 guests

cron