Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have Apache installed on an EC2 instance (with an Elastic IP). I successfully used NameCheap's DNS tool to configure routing of www.mydomain.com and mydomain.com traffic.

If I have a web application living at www.mydomain.com/MyApp, what steps do I take to route MyApp.mydomain.com traffic to www.mydomain.com/MyApp? I don't want it to be a redirect.

share|improve this question
    
DNS is so far out of my comfort area that I don't even know if I should be asking about A, CNAME, or DNAME records. –  Jeromy French Feb 19 '13 at 20:24
2  
Out of interest why not 301 redirect? –  bybe Feb 19 '13 at 20:54

1 Answer 1

I agree with @bybe. A 301 redirect in your .htaccess file would do the trick.

RewriteCond %{HTTP_HOST} ^myapp\.domain\.com
RewriteRule ^(.*)$ http://domain.com/myapp/$1 [R=301]
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.