小编deb*_*deb的帖子

使用mod_rewrite重定向查询字符串(反之亦然)

假设我有带查询字符串的URL,即: /DesignPatterns

使用mod_rewrite,我如何将它们重定向到: /index.php?book=DesignPatterns

这是正确的以下?

 RewriteCond %{QUERY_STRING} (\w+) 
 RewriteRule ^index.php?book=%1? [L,R=301]
Run Code Online (Sandbox Code Playgroud)

PS:原始问题:如何将查询字符串变量与mod_rewrite匹配?(2010年2月12日,Patrick McElhaney,我要求他的许可)

mod-rewrite redirect get

5
推荐指数
1
解决办法
97
查看次数

标签 统计

get ×1

mod-rewrite ×1

redirect ×1