.htaccess redirect to external URL while hiding redirect [duplicate]
Possible Duplicate:
.htaccess redirect to external URL while hiding redirect
Is there a way to rewrite to an external site while hiding the new address?
RewriteRule (.*) http://www.second-website.com/index.php\?string=$1 [NC,L]
The rule works perfectly for a page on the same server, but on a different server it changes the address as if I had used [L,R=301]
.
EDIT: I am using a reverse proxy, but getting a 500 error.
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /foo http://www.second-website.com/foo
ProxyPassReverse /foo http://www.second-website.com/foo
Looks like you need a reverse proxy. It can be implemented in Apache using mod_proxy
. You can use the P
flag if you already have a RewriteRule
.
精彩评论