我想将一个 URL 重定向到另一个 URL,而不更改浏览器 URL
www.example.com/abc/(.*).xml 应重定向到 www.example.com/abc/xyz/index.htm?file=$1
但浏览器应该显示 www.example.com/abc/(.*).xml
您可以使用RewriteRule
:
RewriteEngine On
RewriteRule /abc/(.*)\.xml$ /abc/xyz/index.htm?file=$1 [L]
确保你有mod_rewrite
启用并将其放入您的VirtualHost
配置,或在.htaccess
文件在你的DocumentRoot
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)