1.先去网站后台设置下伪静态
2.根据服务器环境来对应选择伪静态规则
如:
apache-->.htaccess
nginx-->nginx.txt
iis-->web.config
伪静态规则文件在网站根目录下-->rewrite文件夹内
3.伪静态规则详情如下(可复制到对应的伪静态规则内即可)
apache伪静态:
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?p=$1 [QSA,PT,L] </IfModule>
nginx伪静态:
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?p=$1 last; } }
IIS伪静态:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="reIndex" stopProcessing="true"> <match url="^(.*)$" ignoreCase="true" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="index.php?p={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
相关文章
标签:Windows
- •Windows Server 2019 如何修改远程桌面端口?(图文教程)
- •Windows2019系统怎么开启/关闭系统防火墙?(图文教程)
- •Windows server2012 R2怎么关闭系统自动更新?
- •windows 2008系统下怎么安装SQL Server 2019数据库?(图文教程)
- •Windows2016系统怎么开启/关闭系统防火墙?(图文教程)
- •Windows2019系统怎么创建新用户/账号?(图文教程)
- •windows 2008系统下怎么安装SQL Server 2016数据库?(图文教程)
- •Windows2019系统怎么修改系统/远程密码?(图文教程)
- •windows 2012系统下怎么安装SQL Server 2014数据库?(图文教程)
- •Windows Server 2016 如何修改远程桌面端口?(图文教程)