1

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

1
  • 1
    Are there any errors in the Apache error log?
    – Phil Ross
    Aug 10, 2010 at 8:38

2 Answers 2

0

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.

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .