Regex mod rewrite正则表达式问题
为什么这个重写不正确?在我看来,它应该像预期的那样工作 重写规则^/series/([^/]*)$index.php?名称=$1 所以localhost/series/xxxxRegex mod rewrite正则表达式问题,regex,mod-rewrite,Regex,Mod Rewrite,为什么这个重写不正确?在我看来,它应该像预期的那样工作 重写规则^/series/([^/]*)$index.php?名称=$1 所以localhost/series/xxxx 应该重定向到localhost/index.php?name=xxx您正在附加到查询字符串。这意味着您必须将QSA标志附加到规则(查询字符串附加): 另外,正如@FelipeAlamedaA提到的,如果这是在.htaccess中,您应该删除首字母/删除第一个斜杠/series..,然后再试一次。@FelipeAlamed
应该重定向到localhost/index.php?name=xxx您正在附加到查询字符串。这意味着您必须将
QSA
标志附加到规则(查询字符串附加):
另外,正如@FelipeAlamedaA提到的,如果这是在
.htaccess
中,您应该删除首字母/
删除第一个斜杠/series..
,然后再试一次。@FelipeAlamedaA如果这是在.htaccess
中,那么是的——如果这是一个“真正的”站点配置,则不是。
RewriteRule ^/series/([^/]*)$ index.php?name=$1 [QSA]