重写规则无法编译正恩pression [英] RewriteRule cannot compile regular expression
本文介绍了重写规则无法编译正恩pression的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的previous服务器工作正常。今天我换了新的服务器,并得到重写规则不能在我的htaccess编译正EX pression。
My previous server working fine.. Today I changed new server and getting RewriteRule cannot compile regular expression on my htaccess.
如何解决这一行。
RewriteRule ^category/([0-9]+)(?:/([^/]+)(?:/([^/]+))?)(?:/([^/]+)(?:/([^/]+))?)?/$ ./category.php?pid=$1&catname=$2&page=$3 [L]
让我知道:)
推荐答案
您可能正在使用不同版本的Apache使用不同的普通恩pression引擎。由于1.3使用POSIX ERE Apache的版本,而由于2.0使用PCRE版本。而只有PCRE支持非捕获组(?:
的 EXPR
的)
。
You are probably using a different Apache version with a different regular expression engine. The Apache versions since 1.3 use POSIX ERE while the versions since 2.0 use PCRE. And only PCRE support the non-capturing group (?:
expr
)
.
因此,尝试一种模式,没有他们:
So try a pattern without them:
RewriteRule ^category/([0-9]+)(/([^/]+)(/([^/]+))?)(/([^/]+)(/([^/]+))?)?/$ ./category.php?pid=$1&catname=$3&page=$5 [L]
这篇关于重写规则无法编译正恩pression的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文