【发布时间】:2012-05-17 04:51:50
【问题描述】:
apache mod rewrite 对我来说很奇怪:
我试图重定向这个:
http://www.website.com/page.php?id=34
对此:
http://www.website.com/
在 htaccess 中使用它:
RewriteCond %{QUERY_STRING} ^id=([0-9]*)$
RewriteRule ^page\.php$ "http://www.website.com" [R=301,L]
它工作正常,但它也将查询字符串添加到重定向的 url:
http://www.website.com/?id=34
如何从重定向的 url 中删除查询字符串?
【问题讨论】:
标签: apache .htaccess mod-rewrite query-string