zen cart 伪静态规则及伪静态URL 之改写 -【广州网站建设|广州网站制作|广州网站设计|外贸网站建设】

广州网站建设

百分百网络传播机构拥有多年网页设计和网站建设经验,我们立足于广州网站建设市场,结合网站优化经验为各大中小型企业提供网站建设服务,特别是外贸网站建设,已经成功地为广大客户赢得市场。网站建设:020-38680042

« About the Fruit Ninja game modeTemple Run 2 for Android 1.1.1 Now Available for Download »

zen cart 伪静态规则及伪静态URL 之改写

本规则只适应apach服务器下,不能应用到iis中,但在iis的原理也是一样的。 

问题如下:zen cart默认的URL是: taojin.cnmsol.com/2010-ugg-women-romantic-rivet-black-boots-p-93.html 

如果我想改下里面的参数项的数据为其它字符,如把上面的url改成: taojin.cnmsol.com/2010-ugg-women-romantic-rivet-black-boots-nflp-93.html 

修改方法如下: 

zen cart原规则如下: 

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below: 

Options +FollowSymLinks
RewriteEngine On
RewriteBase / 

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+).html$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L] 

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L] 

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L] 

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L] 

经过我修改后的: 

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below: 

Options +FollowSymLinks
RewriteEngine On
RewriteBase /nfljersey1cheap/ 

# From Ultimate SEO URLs
RewriteRule ^(.*)-nflp-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-nflc-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+).html$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L] 

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L] 

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L] 

另外还要修改下:网站根目下的includes/classes/seo.url.php文件中第106行: 

$this->reg_anchors = array(
'products_id' => '-nflp-',
'cPath' => '-nflc-',
'manufacturers_id' => '-m-',
'pID' => '-pi-',
'products_id_review' => '-pr-',
'products_id_review_info' => '-pri-', 

// News & Article Manager SEO support
'news_article_id' => '-a-',
'news_comments_article_id' => '-a-',
'news_dates' => '/',
'news_archive_dates' => '/archive/',
'news_rss_feed' => '/rss', 

// Info Manager (Open Operations)
'info_manager_page_id' => '-i-', 

// EZ-Pages SEO support
'id' => '-ezp-',
);
 

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

我要建站

  • 联系网站建设专家 93216858
  • 联系网站建设专家 38027812
  • 电话:020-38680042
  • 电话:020-38680288
  • 手机:137 11157377 (罗生)
  • 邮箱:admin#gz1024.com
  • 主站:www.gz1024.com

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Devo Build 80201

Copyright 广州网站建设 www.Gz1024.Cn. Some Rights Reserved.