易优CMS伪静态设置方法

- 编辑:admin -

网站后台设置伪静态URL
1、登录网站后台
2、点击左侧菜单导航的“SEO设置”
3、在打开页面中,URL模式选择“伪静态化”、伪静态格式一般选择“目录名称”,这里按照个人需求选择好后就不要更改了,特别是被收录后
 
服务器配置伪静态规则
1、根据自己服务器/空间的环境进行配置,为分IIS、APACHE、NGINX
2、易优CMS是thinkphp底层框架,因此伪静态规则使用TP的即可(宝塔服务器面板里在伪静态直接选择thinkphp的即可)
3、具体规则如下:
 
 
NGINX规则
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
APACHE规则
RewriteEngine on
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
IIS规则
查看服务器的网站根目录下是否有 web.config 文件,将下列红色代码添加<system.webServer>与</system.webServer>之间。如果没有web.config文件,就将全部代码保存为web.config文件,上传到网站根目录下,记得去后台清除缓存,再从网站首页访问。
 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<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>
</system.webServer>
</configuration>