迅睿cms伪静态规则

    nginx环境配置:

    location / {

        if (-f $request_filename) {

            break;

        }

        if ($request_filename ~* "\.(js|ico|gif|jpeg|bmp|png|css)$") {

            break;

        }

        if (!-e $request_filename) {

            rewrite . /index.php last;

        }

    }

    apache环境配置:

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    # 404页面

    ErrorDocument 404 /404.html

    # 不带www跳转到www

    RewriteCond %{HTTP:Host} ^***.com$

    RewriteRule (.*) http://www.***.com/$1 [NC,R=301]

    # xunruicms

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule !.(js|ico|gif|jpeg|bmp|png|css)$ /index.php [NC,L]

    </IfModule>

    iis环境配置:

    <rewrite>

        <rules>

            <rule name="xunruicms IIS 伪静态" stopProcessing="true">

                <match url=".(js|ico|gif|jpeg|bmp|png|css)$" negate="true" />

                <conditions>

                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />

                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />

                </conditions>

                <action type="Rewrite" url="/index.php" />

            </rule>

        </rules>

    </rewrite>