Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi Is it possible to do this using htaccess?

User access -> http://

and it will display the content from -> http://

i did have a htaccess code but its not working maybe theres something missing

<IfModule mod_rewrite.c>
      RewriteRule ^dir/(.*)\.xml${HTTP_HOST}-$1.xml [P] 


share|improve this question
Are there any errors in the Apache error log? – Phil Ross Aug 10 '10 at 8:38
up vote 0 down vote accepted

I RTFMed. It said:

^/somepath(.*) /otherpath$1 [P]                 doesn't make sense, not supported
^/somepath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo
                                            via internal proxy

So it looks like it should work. But..

Note: mod_proxy must be enabled in order to use this flag.

its not working

This is not a meaningful error message. What do your log files show? What happens if you try sending a redirect instead of proxying?


share|improve this answer

First thing that comes to mind is that mod_rewrite isn't on. Just loading the module isn't enough. Somewhere in your config you also need RewriteEngine On to enable it.

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.