gpt4 book ai didi

apache - 重定向而不更改 URL Apache

转载 作者:行者123 更新时间:2023-12-04 18:40:01 25 4
gpt4 key购买 nike

我想将一个 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

关于apache - 重定向而不更改 URL Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28298530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com