1. 当前位置:网站首页 > 技术分享 > php

ThinkPHP Apache和Nginx伪静态规则整理

现在很多系统都是采用ThinkPHP框架,每次都要到网上找半天规则,这里我把规则都整理到一起方便查阅。



第一、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;

}

}


本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://90175.com/wenku/txtlist_i1v.html

联系我们

在线咨询:点击这里给我发消息

微信号:76891828

工作日:9:30-18:30,节假日休息