I want to redirect one URL to another without changing the Browser URL
www.example.com/abc/(.*).xml should redirect to www.example.com/abc/xyz/index.htm?file=$1
But the Browser should display www.example.com/abc/(.*).xml
You can use a
RewriteEngine On RewriteRule /abc/(.*)\.xml$ /abc/xyz/index.htm?file=$1 [L]
Make sure you have
mod_rewrite enabled and put this either in your
VirtualHost config, or in a
.htaccess file in your
As Constantine posted on the accepted solution, the [P] flag is dangerous as it converts the server as a proxy.
P = Proxy. Forces the rule to be handled by mod_proxy. Transparently provide content from other servers, because your web-server fetches it and re-serves it. This is a dangerous flag, as a poorly written one will turn your web-server into an open-proxy and That is Bad.