Thinkphp 常用伪静态

2024-05-24 1,426 0

老是忘记,找起来又费事,所以自己记录一下

nginx

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

apache

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
  SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>

IIS

<rewrite>
 <rules>
 <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>
 </rules>
</rewrite>

相关文章

一个PHP文件搞定微信支付系列之公众号支付
PHP中的日期遍历
PHP使用企业微信接口推送消息
ThinkPhp查询同表字段相同数据
MySQL 中删除重复的数据并只保留一条
PHP手机号中间四位用星号*代替实现详解

发布评论