更新时间:2023-02-23 08:36:15
如果你想捕捉的查询字符串的一部分,你必须使用的 的RewriteCond
与 QUERY_STRING
If you want to capture part of the query string, you must use a RewriteCond
with QUERY_STRING
RewriteEngine On
RewriteCond %{QUERY_STRING} p=(.+)
RewriteRule ^/?index.php$ /%1? [R,L]
这会将客户端重定向到新的URL http://www.domain.net/beer
。
This redirects the client to the new URL http://www.domain.net/beer
.