iis rewrite for zen cart 1.3.8 静态优化移植到IIS服务器
iis下zencart静态SEO实现方法汇总 ISAPI_Rewrite
iis 下zencart静态SEO实现方法汇总,FOR1.2.7&1.3.01
方法A.模块插件式安装,后台可以控制开关。
一..首先安装ISAPI_Rewrite FOR IIS6,用IIS支持REWRITE模块,最新的版本是2.8在这里下载:
ISAPI_Rewrite2.8 下载地址
不管哪个版本的zencart要让IIS实现REWRITE这个是必装的,下完后安装文件是.MIS文件,直接默认安装就可以了.完成后重新启动IIS.
二.安装Ultimate SEO URLs 2.101 for zencart1.3.01/安装Ultimate SEO URLs 2.100 for zencart1.2.7
Ultimate SEO URLs 2.101 下载地址for zencart1.3.01
Ultimate SEO URLs 2.100 下载地址for zencart1.2.7
For this v1.3.0-compatible version, follow the installation instructions at the URL below, (1.3.0版本相对1.2.X的步骤稍有不同)
BUT WITH THE FOLLOWING EXCEPTIONS:
1. skip step #2 … editing application_top.php(参照安装帮助跳过第2步。)
2. steps 3-5, already-edited versions of these files are in the "1301_specific_files" folder. (第3到第5步的文件修改已经包含在1301_specific_files文件夹中)
Simply upload these to the related folder on your site. You should rename the existing file to *.bak before copying.(上传前请务必先保存文件为*.BAK)
3. step 6 … a sample .htaccess file is included. Simply rename to .htaccess and edit the word /shop/ to match your stie(第6步中的.htaccess文件中的内容如果站点在根目录也不用修改)。
安装详细步骤连接参考
INSTALLATION INSTRUCTIONS:
http://www.dream-scape.com/pub/zen … SEO_URLs/install.html
三.取消ISAPI_Rewrite安装目录中的httpd.ini只读属性,然后编写规则
直接把第二步中的.htaccess文件中的内容复制过来.
关键的步骤到了,这也是IIS和APC下的不同
第一: ?改为\?
第二:表示转换符号的 $+空格 改为 空格+/ 这也是我上一次测试没成的原因,这个很关键.
大家可以直接拿.htaccess文件来改
1.3.01 规则
[ISAPI_Rewrite]
##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
Options +FollowSymLinks
Options FollowSymLinks
AllowOverride All
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]
# 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]
1.2.7 规则
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# OLD SEO URLS
# Give a 301 to real URL (which Ultimate SEO will give a 301 to new SEO URL)
# You can remove the following if you were not using the breakmyzen-cart.com SEFU prior to installing this one
# BEGIN SAFE REMOVE
RewriteRule ^(.*)pages-main/category-(.*)/page-([0-9]+)/sort-(.*)/(.*).html index\.php?main_page=index&cPath=$2&page=$3&sort=$4&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-main/category-(.*)/(.*).html index\.php\?main_page=index&cPath=$2&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-productinfo/category-(.*)/product-(.*)/(.*).html index\.php\?main_page=product_info&cPath=$2&products_id=$3&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-productinfo/product-(.*)/(.*).html index\.php\?main_page=product_info&products_id=$2&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-product_reviews_info/product-(.*)/reviews_id-([0-9]+)/(.*).html index\.php\?main_page=product_reviews_info&products_id=$2&reviews_id=$3&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-info_manager/pages_id-([0-9]+)/(.*).html index\.php\?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-product_music_info/product-(.*)/(.*).html index\.php\?main_page=product_music_info&products_id=$2&%{QUERY_STRING} [L,R=301]
RewriteRule ^(.*)pages-(.*)/index.html index\.php\?main_page=$2&%{QUERY_STRING} [L,R=301]
# END SAFE REMOVE
# 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 ^(.*)-pmi-([0-9]+).html$ index\.php\?main_page=product_music_info&products_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]
POSTED ON 2011 年 03 月 24 日,