
最近有接触到ThinkPHP框架,对于这个框架之前有听说应该还是相当有知名度的,但是也用不上就没有去了解。最近技术有开发的项目用的是ThinkPHP,我在部署的时候告诉我用Apache,但是我一般公司部署的WEB环境都是Nginx,然后搜索文档看到还是有Apache和Nginx伪静态规则支持的。
这里把Apache和Nginx伪静态整理出来下次用的时候用Nginx系统,这次就根据他说的先用Apache。
第一、Apache
<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>
第二、Nginx
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
下次需要用的时候直接复制去使用。



© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END