Thinkphp伪静态规则包含(iis/apache/nginx)

 2022-02-21    634  

Thinkphp伪静态规则包含(iis/apache/nginx)

apache伪静态规则如下

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
</IfModule>


nginx伪静态规则如下


location / {
if (!-e $request_filename){
rewrite  ^(.*)$  /index.php?s=$1  last;   break;
}
}


IIS伪静态规则如下:

<rule name="OrgPage" stopProcessing="true">
  <match url="^(.*)$" />
  <conditions logicalGrouping="MatchAll">
  <add input="{HTTP_HOST}" pattern="^(.*)$" />
  <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  </conditions>
  <action type="Rewrite" url="index.php/{R:1}" />
  </rule>


原文链接:https://77isp.com/post/89.html

=========================================

https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。