nginx php和html伪静态
phpstudy中设置:
try_files $uri $uri/ /index.php?$query_string;(php的伪静态) try_files $uri $uri/ /index.html?$query_string;(html的伪静态)
location ~* (runtime|application)/{ return 403; } location /api/ { if (!-e $request_filename){ rewrite ^(.*)$ /api/index.php?s=$1 last;break; } } location /member/ { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } } location /tour/ { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } } location /admin/ { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } } location /new/ { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } } location /news/ { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } } location /edit { if (!-e $request_filename){ rewrite ^(.*)$ /index.html?s=$1 last;break; } }
phpstudy 与 nginx中单独设置:
if (!-e $request_filename){rewrite ^(.*)$ /index.php?s=$1 last; break;}
祝你今天愉快🤗微笑每一天💕💕💕
时间仓促,如有错误欢迎指出,欢迎在评论区讨论,如对您有帮助还请点个推荐、关注支持一下
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文链接,否则保留追究法律责任的权利。
若内容有侵犯您权益的地方,请公告栏处联系本人,本人定积极配合处理或删除。