您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

nginx如何配置多个域名去掉index.php?

2025/5/7 16:22:41发布17次查看
nginx如果配置去掉index.php
location /{
if ($request_filename !~ (system|images|robots\.txt|index\.php.*) ) { rewrite ^/(.*)$ /mobile/index.php/$1 last; } }

这样是可以的
因为在网站根目录下 放了好几个目录 每个目录是不同的内容
我想分别都去掉这几个 mobile app restserver apph5这几个的url路径的index.php
改怎么配置啊
这里有
www----根目录
---mobile--- ---app--- ---restserver--- ---apph5---

回复内容: nginx如果配置去掉index.php
location /{
if ($request_filename !~ (system|images|robots\.txt|index\.php.*) ) { rewrite ^/(.*)$ /mobile/index.php/$1 last; } }

这样是可以的
因为在网站根目录下 放了好几个目录 每个目录是不同的内容
我想分别都去掉这几个 mobile app restserver apph5这几个的url路径的index.php
改怎么配置啊
这里有
www----根目录
---mobile--- ---app--- ---restserver--- ---apph5---

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;}
if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break;}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product