当前位置:首页 > 极致CMS > 关键词 > 伪静态 > 正文

极致CMS伪静态怎么设置,Apache/IIS/Nginx伪静态规则是什么?

极致CMS伪静态配置说明

极致CMS必须使用伪静态,程序自带了 Apache 和 IIS 两种配置,无需再配置。

Apache 配置

系统根目录自带.htaccess文件,如果没有,可新建一个,将下面内容复制进去。

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteBase /
 #RewriteCond %{REQUEST_URI} !((.*).jpg|.jpeg|.bmp|.gif|.png|.js|.CSS|.tts|.woff )$
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
 #RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
 RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L]</IfModule>

IIS 配置

系统根目录自带web.config文件,如果没有,可新建一个,将下面内容复制进去。

<?xml version="1.0" encoding="UTF-8"?><configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="allow_rules" enabled="true" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer></configuration>

Nginx 配置

注意空格不能省略。

location /{
    if ( !-e $request_filename ) {
    rewrite ^(.*)$ /index.php?s=$1 last;
    }
}

本文属原创,转载请注明原文:https://www.zhimatong.com/jiaocheng/909.html

为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。

点赞 1

联系
顾问

在线
客服
账号登录

没有账号?立即注册

忘记密码

登录即同意用户协议没有账号? 立即注册
账号注册
我已阅读并同意用户协议
立即注册
注册即同意用户协议已有账号? 立即登录
找回密码

操作步骤:邮箱验证->设置新密码

注册即同意用户协议已有账号? 立即登录