草邦CMS开发手册

网站CMS


伪静态配置

<h2>伪静态配置</h2> <blockquote> <p>标签作用:配置程序伪静态后URL中将不再包含index.php,整个地址更美观</p> </blockquote> <h3>1、IIS7+环境(IIS6的环境自行百度):</h3> <p>如果你的服务器环境支持ISAPI_Rewrite的话,可以配置httpd.ini文件,添加下面的内容:</p> <p><code>RewriteRule (.*)$ /index\.php\?s=$1 [I]</code></p> <p>在IIS的高版本下面可以配置web.Config,在中间添加rewrite节点:</p> <pre><code class="language-html"> &lt;rewrite&gt; &lt;rules&gt; &lt;rule name="已导入的规则 1" stopProcessing="true"&gt; &lt;match url="^(.*)$" ignoreCase="true" /&gt; &lt;conditions logicalGrouping="MatchAll"&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /&gt; &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /&gt; &lt;/conditions&gt; &lt;action type="Rewrite" url="index.php/{R:1}" /&gt; &lt;/rule&gt; &lt;/rules&gt; &lt;/rewrite&gt;</code></pre> <h3>2、Apache环境</h3> <p>1)开启Apache重写模块,具体请百度,如果使用空间一般空间商默认已经开启;</p> <p>2)到后台配置参数中开启伪静态开关;</p> <p>3)在站点目录建立.htaccess文件(可到源码包rewrite目录下拷贝规则),规则内容如下:</p> <pre><code class="language-html">#使用如下规则: &lt;IfModule mod_rewrite.c&gt; Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?p=$1 [QSA,PT,L] &lt;/IfModule&gt; </code></pre> <h3>3、Nginx伪静态规则</h3> <pre><code class="language-html">location / { index index.html index.htm index.php l.php; autoindex on; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } }</code></pre> <hr /> <h2>草邦CMS官方QQ群</h2> <blockquote> <h5>草邦CMS快速技术服务QQ 1227187938(仅对付费用户)</h5> <h5>草邦CMS 群3 317446696</h5> </blockquote>

页面列表

ITEM_HTML