一、打开代码配置文件config.php 开启伪静态(false改成true)php
二、后台开启pathinfo模式nginx
三、环境配置web
找到nginx的配置文件Nginx.conf添加伪静态配置代码(如下代码)服务器
location / {ide
if \(!-e $request\_filename\) { rewrite ^\(.\*\)$ /index.php?s=$1 last; break; }
}url
一、httpd.conf配置文件中加载了mod_rewrite.so模块spa
二、AllowOverride None 将None改成 Allcode
若是你的服务器环境支持ISAPI_Rewrite的话,能够配置httpd.ini文件,添加下面的内容:blog
RewriteRule (.*)$ /index.php\?s=$1 [I]教程
在IIS的高版本下面能够配置web.Config,在中间添加rewrite节点:
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^(.*)[ DISCUZ_CODE_1 ]quot; />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(.*)[ DISCUZ_CODE_1 ]quot; />
<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>
4、配置后对比
配置前
配置后