Example of iis/apache pseudo-static rule configuration in ecshop

Source: Internet
Author: User

Example of pseudo-static rules in apache

Copy the following code and save it as. htaccess to the root directory of the site. (Make sure that your space/server is installed with apache. If it is iis, please refer to the pseudo-static rule example of ecshop under iis in proxy Ruibo)

The code is as follows: Copy code

<FilesMatch "\. (bak | inc | lib | sh | tpl | lbi | dwt) $">
Order deny, allow
Deny from all
</FilesMatch>

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]

Example of pseudo-static rules in iis

Copy the following code and save it as web. config to the root directory of the site. (Make sure that your space/server is iis installed. If it is apache, please refer to the pseudo-static rule example of ecshop under apache in proxy Ruibo)

The code is as follows: Copy code

<? Xml version = "1.0" encoding = "UTF-8"?>
<Configuration>
<System. webServer>
<Rewrite>
<Rules>
<Rule name = "index">
<Match url = "your index.html"/>
<Action type = "Rewrite" url = "index. php"/>
</Rule>
<Rule name = "category">
<Match url = "^ (. */) * category.html"/>
<Action type = "Rewrite" url = "{R: 1}/category. php"/>
</Rule>
<Rule name = "category0">
<Match url = "^ (. */) * category-(%0-9%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/category. php \? Id = {R: 2} "/>
</Rule>
<Rule name = "category1">
<Match url = "^ (. */) * category-([0-9] +)-([0-9] +)-(\ w+)).html"/>
<Action type = "Rewrite" url = "{R: 1}/category. php \? Id = {R: 2} & amp; page = {R: 3} "/>
</Rule>
<Rule name = "brands">
<Match url = "^ (. */) * brands-(%0-9%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/brands. php \? Id = {R: 2} "/>
</Rule>
<Rule name = "article">
<Match url = "^ (. */) * article-(%0-9%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/article. php \? Id = {R: 2} "/>
</Rule>
<Rule name = "article_cat">
<Match url = "^ (. */) * article_cat-(%0-9%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/article_cat.php \? Id = {R: 2} "/>
</Rule>
<Rule name = "article_cat_page">
<Match url = "^ (. */) * article_cat-(%0-9%%%%)-(%0-9%%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/article_cat.php \? Id = {R: 2} & amp; page = {R: 3} "/>
</Rule>
<Rule name = "goods">
<Match url = "^ (. */) * goods-(%0-9%%%%%.html"/>
<Action type = "Rewrite" url = "{R: 1}/goods. php \? Id = {R: 2} "/>
</Rule>
<Rule name = "contact">
<Match url = "^ (. */) * contact.html"/>
<Action type = "Rewrite" url = "{R: 1}/contact. php"/>
</Rule>
<Rule name = "search">
<Match url = "^ (. */) * search-([a-za-z?##.html"/>
<Action type = "Rewrite" url = "{R: 1}/search. php \? Intro = {R: 2} "/>
</Rule>
<Rule name = "maps">
<Match url = "^ (. */) * maps.html"/>
<Action type = "Rewrite" url = "{R: 1}/maps. php"/>
</Rule>
</Rules>
</Rewrite>
</System. webServer>
</Configuration>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.