【发布时间】:2010-07-16 07:52:24
【问题描述】:
我想重写一个特定的 URL,我将展示一个示例,以便您理解我的意思。
首先,我目前的重写规则:
重写规则 ^/?([a-zA-Z0-9/-]+)/?$ /index.php [NC,L]
现在我想要这个网址:
http://example.tld/foobar?test
改写为:
http://example.tld/foobar
注意:仅适用于/foobar?test!例如。不适用于/somethingelse?test,也不适用于/foobar?blah!
提前致谢!
编辑: 我意识到我想要从 /foobar?test 到 /foobar 的 301 重定向,而不是“传统”重写。希望这是可能的。
【问题讨论】:
标签: apache .htaccess mod-rewrite rewrite