Link to home
Start Free TrialLog in
Avatar of movieprodw
movieprodw

asked on

htaccess check domain then redirect if

Hello,

I have domains

1.com
2.com
3.com
4.com
home.com

They are all running off the same web server pointed to home.com

Their domain stays 1/2/3/4

Their is a directory called /account

If #.com/account then redirect to home.com/account

If home.com/account then do nothing
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Try this:
rewriterule ^account(.*)$ http://home.com/account$1 [r=301,nc]

Open in new window

HTH,
Dan
Avatar of movieprodw
movieprodw

ASKER

This is what I get:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

Open in new window


Note: they both have the same htaccess
I think that's because I created a circular reference, so the server will keep trying to get to http://home.com/account.

Let me find out how I can prevent the server from redirecting if it's already on that page.
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

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
Perfect
Glad I could help!