对于nginx伪静态规则配置!
当nginx配置如下
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
URL为这样的有效!http://lhj.org/index.php/Cont...
当nginx配置如下
if (!-e $request_filename) {
rewrite ^/system.php(.*)$ /system.php?s=$1 last;
rewrite ^(.*)$ /system.php?s=$1 last;
break;
}
URL为这样的有效http://lhj.org/system.php/Pub...
请教各位大神,如果同时要满足http://lhj.org/index.php/Cont...
和http://lhj.org/system.php/Pub... 要如何配置nginx?
你先去学学正则表达式吧,不难,很快就能理解的。然后再来试着回答你自己的问题。
我是可以直接告诉你答案,但如果遇到其他情况(比如又冒出个user.php)你怎么办?