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

I have a domain which has a hosting package and website on it.

I also have a domain which contains some content I would like to appear under the same domain.

Can I setup a .htaccess file at which proxies the files at

Similarly, could I host an entire domain in the same way?, e.g. proxying

Alternatively, if someone were to say "That's stupid, use this free (or super-cheap) dynamic DNS host:" I would probably accept that answer.

share|improve this question
Is there a reason why you can't simply put all the content on one host and eliminate the problem completely? – John Gardeniers Mar 29 '10 at 23:38
That host doesn't allow ssh access, and I like to update via git. – Dean Rather Mar 30 '10 at 0:02

2 Answers 2

up vote 1 down vote accepted

Basically, you'd need to setup a Reverse Proxy. In Apache, this is done using ProxyPass and ProxyPassReverse, but these directives can't be used in .htaccess.

There is a proxy option in mod_rewrite, so if mod_rewrite and mod_proxy is enabled, you could maybe use something like

RewriteRule ^/(.*)$$1 [P]

in your .htaccess, this would proxy to Redirects etc. sent from the backend will not work since you can't specify ProxyPassReverse. All in all not the way to go, so either putting everything in the same server or registering a DNS entry are both way better options.

share|improve this answer
DNS is out because getting a Static IP on my ISP is magnitudes costlier than getting a cheap hosting package... Thanks for the response though I'll try it out. – Dean Rather Mar 30 '10 at 0:05
Or, if you really have to do it as you described, but you can't configure Apache to do it, you could use a "handmade" proxy in PHP or CGI. – C. Ramseyer Mar 30 '10 at 0:05

Nope But you can use apache's mod proxy to do something similar:

share|improve this answer

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.