- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
环境
Ubuntu 14.04+Nginx+MySQL。所有程序都是通过apt-get安装的,所以Nginx的配置文件路径在/etc/nginx/sites-available/default。
解决方法
定位到Nginx配置文件的如下部分:
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
加入下面的代码:
if (!-e $request_filename)
{
rewrite ^/myapp/(.*)$ /myapp/index.php?s=$1 last;
break;
}
正则的写法
解决这个问题的时候,看到了好几种解决方案,光正则就看到了好几个,也不知道到底哪个是最标准的,本人正则也不是很熟,先记录下来,以后慢慢研究:
正则1:
rewrite ^/MYAPP/(.*)$ /MYAPP/index.php/$1 last;
正则2:
rewrite ^(.*)$ /index.php?s=$1 last;
售前咨询
售后咨询
备案咨询
二维码
TOP