Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have my main URL (www.example1.com) and I want to redirect my parked domain (www.example2.com) to my main domain, but carry over anything after the root URL.

So I want www.example2.com/home to redirect to www.example1.com/home AND www.example2.com/about to www.example1.com/about, etc...

I tried using a wildcard redirect, but that didn't work.

Any help is appreciated.

share|improve this question

2 Answers 2

  RewriteCond %{HTTP_HOST} ^example1\.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.example1\.com$
  RewriteRule ^(.*)$ http://example2.com/$1 [R=301,L]

You could also do it in apache for the example1.com domain

Redirect permanent / http://domain2.com/
share|improve this answer

Do you really need to redirect one domain to the other?
If both domains have to load the same source code, you can use ServerAlias (Apache) or Host Headers (IIS) and have only one website with multiple domain names listening, all domains must be pointed to the same webserver.
Let me know and i will assist you on how you can do this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.