zencart是一个php的程序,默认运行在linux平台下的Apache服务器,若要运行在win平台下的iis服务器下,要启用伪静态,就必须另外编写规则的,笔者在为客户处理问题的时候接触过这个,所以,就将伪静态的规则贴出来和大家分享。(规则保存为httpd.ini 传到网站的根目录[是网站根目录,不是FTP根目录])
[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 / RepeatLimit 32 RewriteCompatibility2 On
# From Ultimate SEO URLs RewriteRule ^(.*)-p-([0-9]+)(.*)$ /index\.php\?main_page=product_info&products_id=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-m-([0-9]+)(.*)$ /index\.php\?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-pi-([0-9]+)(.*)$ /index\.php\?main_page=popup_image&pID=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-pr-([0-9]+)(.*)$ /index\.php\?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-pri-([0-9]+)(.*)$ /index\.php\?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ /index\.php\?main_page=page&id=$2&%{QUERY_STRING} [L] RewriteRule ^(.*)-c-([0-9_]+)(.*)$ /index\.php\?main_page=index&cPath=$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] RewriteRule ^tags/?$ /index\.php\?main_page=tags_item&tag_name=&%{QUERY_STRING} [L]
# All other pages # Don't rewrite real files or directories RewriteRule (?!\/mages)(?!\/bmz_cache)(?!\/includes\/templates)(.*) $ /index\.php/$1 [I]
这里特别说明一下最后一行,最后一行是将重要的目录屏蔽伪静态的,比如模版目录,图片,css,js等目录。还有管理目录给去掉伪静态,一般使用 (?!\/aaa)这样的方式,aaa是相对网站根目录地址名称,如果是要屏蔽多级子文件夹目录的话,那可以使用这样的(?!\/aaa\/bbb\/ccc)就可以。
|