如何实现ECShop伪静态

    0
    4032

    ECShop是目前比较热门的独立网店系统,适合企业以及个人快速搭建个性化网上商店,系统基于PHP+MySQL开发,是一款免费的开源网店程序。在这里,必盛互联将为您介绍如何在必盛互联的ECShop主机上安装ECShop之后实现伪静态。
    ECShop主机
    必盛互联的ECShop主机基于Windows主机环境开发,支持PHP 5.2/5.2/5.3,MySQL 5,FastCGI能够完美运行PHP程序。在IIS 7.5下实现ECShop静态化也很简单。只需要就ECShop静态化文件写入到Web.config文件即可。

    具体操作如下:

    1.打开必盛互联控制面板,“文件管理器”,在网站wwwroot下打开web.config文件。

    2.将web.config文件copy到本地记事本或者Notepad++进行编辑。注意存在的web.config文件不要删除,否则会导致网站无法访问。

    3.将下列ECShop静态化代码添加至红色位置,确保添加正确。

    ECShop主机
    ECShop静态化代码:

    <rewrite>

                 <rules>

                   <rule name=”Goods” stopProcessing=”true”>

                          <match url=”^goods-([0-9]+).html” />

                          <action type=”Rewrite” url=”goods.php?id={R:1}” />

                     </rule>

                     <rule name=”Feed” stopProcessing=”true”>

                         <match url=”^feed.xml” />

                         <action type=”Rewrite” url=”feed.php”  />

                     </rule>

                     <rule name=”Feed-C” stopProcessing=”true”>

                         <match url=”^feed-c([0-9]+).xml” />

                         <action type=”Rewrite” url=”feed.php?cat={R:1}”  />

                     </rule>

                     <rule name=”Feed-B” stopProcessing=”true”>

                         <match url=”^feed-b([0-9]+).xml” />

                         <action type=”Rewrite” url=”feed.php?brand={R:1}”  />

                     </rule>

         <rule name=”Articles” stopProcessing=”true”>

                         <match url=”^article-([0-9]+).html” />

                         <action type=”Rewrite” url=”article.php?id={R:1}”  />

                     </rule>

                     <rule name=”Search” stopProcessing=”true”>

                         <match url=”^tag-([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”search.php?keywords={R:1}”  />

                     </rule>

                     <rule name=”Snatch” stopProcessing=”true”>

                         <match url=”^snatch-([0-9]+).html” />

                         <action type=”Rewrite” url=”snatch.php?id={R:1}”  />

                     </rule>

                     <rule name=”Group_Buy” stopProcessing=”true”>

                         <match url=”^group_buy-([0-9]+).html” />

                         <action type=”Rewrite” url=”group_buy.php?act=view&amp;id={R:1}”  />

                     </rule>

                     <rule name=”Auction” stopProcessing=”true”>

                         <match url=”^auction-([0-9]+).html” />

                         <action type=”Rewrite” url=”auction.php?act=view&amp;id={R:1}”  />

                     </rule>

                     <rule name=”Brand1″ stopProcessing=”true”>

                         <match url=”^brand-([0-9]+).html” />

                         <action type=”Rewrite” url=”brand.php?id={R:1}”  />

                     </rule>

                     <rule name=”Brand2″ stopProcessing=”true”>

                         <match url=”^brand-([0-9]+)-c([0-9]+).html” />

                         <action type=”Rewrite” url=”brand.php?id={R:1}&amp;cat={R:2}”  />

                     </rule>

                     <rule name=”Brand3″ stopProcessing=”true”>

                         <match url=”^brand-([0-9]+)-c([0-9]+)-([0-9]+).html” />

                         <action type=”Rewrite” url=”brand.php?id={R:1}&amp;cat={R:2}&amp;page={R:3}”  />

                     </rule>

                     <rule name=”Brand4″ stopProcessing=”true”>

                         <match url=”^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”brand.php?id={R:1}&amp;cat={R:2}&amp;page={R:3}&amp;sort={R:4}&amp;order={R:5}”  />

                     </rule>

                     <rule name=”Cat1″ stopProcessing=”true”>

                         <match url=”^article_cat-([0-9]+).html” />

                         <action type=”Rewrite” url=”article_cat.php?id={R:1}”  />

                     </rule>

                     <rule name=”Cat2″ stopProcessing=”true”>

                         <match url=”^article_cat-([0-9]+)-([0-9]+).html” />

                         <action type=”Rewrite” url=”article_cat.php?id={R:1}&amp;page={R:2}”  />

                     </rule>

                     <rule name=”Cat3″ stopProcessing=”true”>

                         <match url=”^article_cat-([0-9]+)-([0-9]+)-(.+)-([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”article_cat.php?id={R:1}&amp;page={R:2}&amp;sort={R:3}&amp;order={R:4}”  />

                     </rule>

                     <rule name=”Category1″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}”  />

                     </rule>

                     <rule name=”Category2″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+)-b([0-9]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}&amp;brand={R:2}”  />

                     </rule>

                     <rule name=”Category3″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+)-b([0-9]+)-([0-9]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}&amp;brand={R:2}&amp;page={R:3}”  />

                     </rule>

                     <rule name=”Category4″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}&amp;brand={R:2}&amp;page={R:3}&amp;sort={R:4}&amp;order={R:5}”  />

                     </rule>

                     <rule name=”Category5″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}&amp;brand={R:2}&amp;price_min={R:3}&amp;price_max={R:4}&amp;filter_attr={R:5}”  />

                     </rule>

                     <rule name=”Category6″ stopProcessing=”true”>

                         <match url=”^category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([_0-9a-z-]+)-([0-9]+)-(.+)-([_0-9a-z-]+).html” />

                         <action type=”Rewrite” url=”category.php?id={R:1}&amp;brand={R:2}&amp;price_min={R:3}&amp;price_max={R:4}&amp;filter_attr={R:5}&amp;page={R:6}&amp;sort={R:7}&amp;order={R:8}”  />

                     </rule>

        </rules>

             </rewrite>
    4.添加完毕之后将整个web.config覆盖控制面板中的web.config文件。

    5.登录ECShop后台,开启静态化。

    ECShop主机

    6.静态化设置成功,访问产品页面。

    ECShop主机