点击数:34012018-07-07 18:52:57 来源: 外贸网站建设,深圳外贸网站建设,深圳网站建设,外贸商城网站制作-亿恩科技
zencart如何开启伪静态
登录zencart系统后台Configuration分下拉SEO urls开启(官网英文版是需要另外按装插件的而简体中文版是集成)如下图操作,英文版类似
伪静态规则代码如下
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Disable if using "Categories as Directories"
#RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)\.html$ $3-p-$4\.html?cPath=$2&%{QUERY_STRING} [R=301,L]
# Enable only if using "Categories as Directories"
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)\.html$ index\.php?main_page=product_info&products_id=$4&cpath=$2&%{QUERY_STRING} [L]
# Normal operation Ultimate SEO URLs
RewriteRule ^(.*)-p-([0-9]+)\.html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
# Disable if using "Categories as Directories"
#RewriteRule ^(.*)-c-([0-9_]+)\.html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
#RewriteRule ^(.*)-c-([0-9_]+)/$ $1-c-$2\.html [R=301,L]
# Enable only if using "Categories as Directories"
RewriteRule ^(.*)-c-([0-9_]+)/?\.html$ $1-c-$2/ [R=301,L]
RewriteRule ^(.*)-c-([0-9_]+)$ %{REQUEST_URI}/ [R=301,L]
RewriteRule ^(.*)-c-([0-9_]+)/$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
# Normal operation Ultimate SEO URLs
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]
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]
# Handle when a resource is not found (404 Error Page)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php?main_page=page_not_found&%{QUERY_STRING} [L]
如果丢失文件直接上面复制,保存成.htaccess放到zencart网站根目录直接使用
备注:说明网站放在根目录下 直接用RewriteBase /, 如果放在二级szenw文件夹名称,则RewriteBase /szenw/