ThinkPHP Apache和Nginx伪静态规则整理

2018-05-2409:02:42服务器及运维Comments3,375 views字数 443阅读模式

技术有开发的项目用的是ThinkPHP,我在部署的时候告诉我用Apache,但是我一般公司部署的WEB环境都是Nginx,然后搜索文档看到还是有Apache和Nginx伪静态规则支持的。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

这里把Apache和Nginx伪静态整理出来下次用的时候用Nginx系统,这次就根据他说的先用Apache。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

第一、Apache文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

第二、Nginx文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

下次需要用的时候直接复制去使用。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/3577.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/yunwei/3577.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定