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

I would like to manage subdomains exclusively through .htaccess.

I am able to catch subdomains that I set up - for example, support.testsite.com - currently, I redirect that to testsite.com/support.

What I would like to do is retain the subdomain, even after the redirect - so support.testsite.com seems to stay in the address bar for the user, even though it is actually located at testsite.com/support.

Should I maintain another .htaccess file in /support that rewrites the address?


share|improve this question

migrated from superuser.com Aug 31 '10 at 18:56

This question came from our site for computer enthusiasts and power users.

Sounds like a potential question for Server Fault –  KronoS Aug 31 '10 at 16:46
This sounds like a job for mod_rewrite! –  sysadmin1138 Aug 31 '10 at 17:13

1 Answer 1

You need to setup reverse proxy in the virtual domain support.testsite.com.

Load following modules into your apache: mod_proxy, mod_proxy_http

ProxyPass / http://testsite.com/support/
<Location />
  ProxyPass / https://testsite.com/support/

Just a warning: expect some fiddling around making your application work correctly behind reverse proxy - some more reading can be found on mod_proxy_html apache docs and mod_proxy_html homepage.

share|improve this answer

Your Answer


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