环境配置:Apache + PHP5.6以上 + MySQL5.5以上(推荐使用宝塔面板一键安装)
PHP函数:file_put_contents(),str_replace(),curl_init(),htmlspecialchars_decode(),strip_tags(),相关扩展需要开启
伪静态:Apache需要加载mod_rewrite.so模块
<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>
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSAPTL]
</IfModule>
不行就去掉?号:RewriteRule ^(.*)$ index.php/$1 [QSAPTL]
还不行就替换成:RewriteRule ^(.*)$ index.php [LE=PATH_INFO:$1]
Nginx需要开启PATHINFO,因为每个版本的开启不一样,请自行翻阅相关资料配置
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}