Link to home
Start Free TrialLog in
Avatar of lynxIT
lynxIT

asked on

Simple htaccess redirection

Hi Guys,
Quick and easy one (I think!) for someone who knows what they are doing!

I need to redirect our .org domain to the .com domain, but without all .org pages going to the .com index.

For example, I need www.xyz.org to go to www.xyz.com but also www.xyz.org/folder/index.php to go to www.xyz.com/folder/index.php

The directory structure is identical on both domains (which are on separate servers), and we're moving the .com domain.  I'm getting lost in .htaccess can anyone help?  Also need the code the deal with URLs with and without the www part.

Any thoughts?
ASKER CERTIFIED SOLUTION
Avatar of MountMann
MountMann

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lynxIT
lynxIT

ASKER

Thats great - thanks

I've just realised that although the folder structure is the same its all within a html directory, so I'm guessing I could change:

RewriteRule ^(.*)$ http://www.xyz.com/$1 [R=301,L]

to

RewriteRule ^(.*)$ http://www.xyz.com/home/$1 [R=301,L]

and it would work?