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.

Is it possible to put a reverse proxy in an .htaccess file? Something like this:

ProxyPass /path/
ProxyPassReverse /path/

If not, are there other options?

EDIT Because I've got a domain like domain.com and a path in it like /path so that domain.com/path redirects to

This works, but I'd like to set it up so when I'm at after the redirect the URL bar at the top of the browser reads domain.com/path and so that any subfolders therein would be accessible via domain.com/path/subfolders.

share|improve this question
Why don't you just test it? –  mgorven Feb 5 '13 at 23:21
Could you elaborate on why? –  Stephan Feb 5 '13 at 23:39
Thanks for the reply; see the edit above. –  emm Feb 5 '13 at 23:43

1 Answer 1

According to the mod_proxy documentation:

Context: server config, virtual host, directory

Which doesn't include ".htaccess", and so the answer is no.

share|improve this answer
Would you happen to know if I can achieve a URL mask with RewriteRule? I want to replace with the domain this .htaccess file is on with the path of /path above. These rewrite rules confuse me. –  emm Feb 5 '13 at 23:38

Your Answer


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.