首页 > 网站运行/故障 > PbootCMS伪静态-windows/linux主机设置方法

PbootCMS伪静态-windows/linux主机设置方法

一、pbootcms在linux主机上设置伪静态方法

在linux虚拟主机网站根目录下的.htaccess加入以下代码即可

<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>

如你的根目录下没有.htaccess,可自已创建个,创建个.txt的文件,把以上代码写入到txt里,上传到主机根目录,在重命名为.htaccess即可。

二、bootcms在windows主机上设置伪静态方法

windows主机的伪静态文件是web.config,里面也放了伪静态代码,如下:

<?xml version=”1.0″ encoding=”UTF8″?>
<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/{R:1}” appendQueryString=”true” />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

如你的根目录里没有web.config,可自已创建个,创建个.txt的文件,把以上代码写入到txt里,上传到主机根目录,在重命名为web.config即可。

发表回复