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.

  • 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? – Simon Hayter Feb 19 '13 at 20:54

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]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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