假设我有带查询字符串的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,我要求他的许可)