一聚教程网:一个值得你收藏的教程网站

热门教程

ecshop中iis/apache伪静态规则配置示例

时间:2022-06-25 16:23:40 编辑:袖梨 来源:一聚教程网

apache下的伪静态规则范例

复制下面这段代码,然后存为 .htaccess 放到站点的根目录下面就行了。(请确保您的空间/服务器是安装的apache,如果是iis,请参考代潇瑞博客中的 ecshop在iis下的伪静态规则范例)

 代码如下 复制代码


    order deny,allow
    deny from all

RewriteEngine On
RewriteBase /

# direct one-word access
RewriteRule ^index\.html$    index\.php [L]
RewriteRule ^category$      index\.php [L]

# access any object by its numeric identifier
RewriteRule ^feed-c([0-9]+)\.xml$    feed\.php\?cat=$1 [L]
RewriteRule ^feed-b([0-9]+)\.xml$    feed\.php\?brand=$1 [L]
RewriteRule ^feed-type([^-]+)\.xml$  feed\.php\?type=$1 [L]
RewriteRule ^feed\.xml$     feed\.php [L]

RewriteRule ^category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$  category\.php\?id=$1&brand=$2&page=$3  [QSA,L]
RewriteRule ^category-([0-9]+)-b([0-9]+)(.*)\.html$   category\.php\?id=$1&brand=$2  [QSA,L]
RewriteRule ^category-([0-9]+)(.*)\.html$   category\.php\?id=$1  [QSA,L]

RewriteRule ^goods-([0-9a-zA-Z_]+)-([0-9]+)(.*)\.html$  goods\.php\?id=$2 [QSA,L]
RewriteRule ^goods-([0-9]+)(.*)\.html$   goods\.php\?id=$1 [QSA,L]

RewriteRule ^article_cat-([0-9]+)-([0-9]+)(.*)\.html$                   article_cat\.php\?id=$1&page=$2   [QSA,L]
RewriteRule ^article_cat-([0-9]+)(.*)\.html$                            article_cat\.php\?id=$1   [QSA,L]
RewriteRule ^article-([0-9]+)(.*)\.html$                                article\.php\?id=$1   [QSA,L]

RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html   brand\.php\?id=$1&cat=$2&page=$3&sort=$4&order=$5 [QSA,L]
RewriteRule ^brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html                brand\.php\?id=$1&cat=$2&page=$3 [QSA,L]
RewriteRule ^brand-([0-9]+)-c([0-9]+)(.*)\.html                         brand\.php\?id=$1&cat=$2 [QSA,L]
RewriteRule ^brand-([0-9]+)(.*)\.html                                   brand\.php\?id=$1 [QSA,L]

RewriteRule ^tag-(.*)\.html                                             search\.php\?keywords=$1 [QSA,L]
RewriteRule ^snatch-([0-9]+)\.html$                                     snatch\.php\?id=$1 [QSA,L]
RewriteRule ^group_buy-([0-9]+)\.html$                                  group_buy\.php\?act=view&id=$1 [QSA,L]
RewriteRule ^auction-([0-9]+)\.html$                                    auction\.php\?act=view&id=$1 [QSA,L]

iis下的伪静态规则范例

复制下面的代码,存为 web.config 放到站点的根目录下面就行了。(请确保您的空间/服务器是安装的iis,如果是apache,请参考代潇瑞博客中的 ecshop在apache下的伪静态规则范例)

 代码如下 复制代码



 
  
   
    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    
     
     
    

    ps">
     
     
    

   

  

 

热门栏目