Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got two sites (example1.com and example2.com). I'd like to forward example1.com to example2.com/example1. Is there a way of doing this with just DNS? I know I could set up hosting for both domains and then just use a HTTP redirect, but I'd rather just have one hosting account. I'm with NearlyFreeSpeech if that helps.

share|improve this question

migrated from stackoverflow.com Oct 12 '09 at 11:20

This question came from our site for professional and enthusiast programmers.

    
I don't think so no. It is possible that you could do something just with DNS provided your web server supported it, but I don't know of anything that does that. – Nick Craig-Wood Oct 10 '09 at 13:28
2  
This question might be more appropriate for Server Fault. – Rob H Oct 10 '09 at 13:30

Not with DNS alone because DNS only deals with host names, not paths.

share|improve this answer

Duplicate of many other questions. You should search before posting.

share|improve this answer

No, there is not. You need to use a rewrite or redirect to accomplish your goal.

In your Apache VirtualHost config for example1.com:

RedirectPermanent example1.com http://example2.com/example1
share|improve this answer

Your Answer

 
discard

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