nginx如果配置去掉index.php
location /{
<code>if ($request_filename !~ (system|images|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /mobile/index.php/$1 last;
}
}</code>这样是可以的
因为在网站根目录下 放了好几个目录 每个目录是不同的内容
我想分别都去掉这几个 mobile app restserver apph5这几个的url路径的index.php
改怎么配置啊
这里有
www----根目录
<code> ---mobile--- ---app--- ---restserver--- ---apph5--- </code>
nginx如果配置去掉index.php
location /{
立即学习“PHP免费学习笔记(深入)”;
<code>if ($request_filename !~ (system|images|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /mobile/index.php/$1 last;
}
}</code>这样是可以的
因为在网站根目录下 放了好几个目录 每个目录是不同的内容
我想分别都去掉这几个 mobile app restserver apph5这几个的url路径的index.php
改怎么配置啊
这里有
www----根目录
<code> ---mobile--- ---app--- ---restserver--- ---apph5--- </code>
<code>if (!-e $request_filename) {
rewrite ^/mobile/(.*)$ /mobile/index.php/$1 last;
rewrite ^/app/(.*)$ /app/index.php/$1 last;
rewrite ^/restserver/(.*)$ /restserver/index.php/$1 last;
rewrite ^/apph5/(.*)$ /apph5/index.php/$1 last;
}</code>
<code>if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
</code>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号