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

Hi Is it possible to do this using htaccess?

User access -> http:// mydomaina.com/dir/filename

and it will display the content from -> http:// mymainsite.com/anydir/mydomaina-filename

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

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

Thanks

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

2 Answers 2

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?

C.

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.

http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteengine

share|improve this answer

Your Answer

 
discard

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.