Collation of pseudo-static rules for Nginx servers of common php cms in China

Source: Internet
Author: User

However, many users still do not know the pseudo-static rules of the Nginx server. If you install common programs such as WordPress, PHPCMS, ECSHOP, SHOPEX, and Discuz 7, the pseudo-static rules are ready for use. To facilitate webmasters, we have collected pseudo-static rules for these common programs.
WordPress pseudo-static rules Copy codeThe Code is as follows: location /{
Index index.html index. php;
If (-f $ request_filename/index.html ){
Rewrite (. *) $1/index.html break;
}
If (-f $ request_filename/index. php ){
Rewrite (. *) $1/index. php;
}
If (! -F $ request_filename ){
Rewrite (. *)/index. php;
}
}

PHPCMS pseudo-static rulesCopy codeThe Code is as follows: location /{
### PHPCMS pseudo-static rewrite Rules
Rewrite ^ (. *) show-([0-9] +)-([0-9] +) \. html $1/show. php? Itemid = $2 & page = $3;
Rewrite ^ (. *) list-([0-9] +)-([0-9] +) \. html $1/list. php? Catid = $2 & page = $3;
Rewrite ^ (. *) show-([0-9] +) \. html $1/show. php? Specialid = $2;
#### PHPWind pseudo-static rewrite Rules
Rewrite ^ (. *)-htm-(. *) $ 1.php? $2 last;
Rewrite ^ (. *)/simple/([a-z0-9 \ _] + \. html) $1/simple/index. php? $2 last;
}

ECSHOP pseudo-static rulesCopy codeThe Code is as follows: if (! -E $ request_filename)
{
Rewrite "^/index \. html"/index. php last;
Rewrite "^/category $"/index. php last;
Rewrite "^/feed-c ([0-9] +) \. xml $"/feed. php? Cat = $1 last;
Rewrite "^/feed-B ([0-9] +) \. xml $"/feed. php? Brand = $1 last;
Rewrite "^/feed \. xml $"/feed. php last;
Rewrite "^/category-([0-9] +)-B ([0-9] +)-min ([0-9] +) -max ([0-9] +)-attr ([^-] *)-([0-9] + )-(. +)-([a-zA-Z] + )(. *)\. html $ "/category. php? Id = $1 & brand = $2 & price_min = $3 & price_max = $4 & filter_attr = $5 & page = $6 & sort = $7 & order = $8 last;
Rewrite "^/category-([0-9] +)-B ([0-9] +)-min ([0-9] +) -max ([0-9] +)-attr ([^-] *) (. *)\. html $ "/category. php? Id = $1 & brand = $2 & price_min = $3 & price_max = $4 & filter_attr = $5 last;
Rewrite "^/category-([0-9] +)-B ([0-9] +)-([0-9] + )-(. +)-([a-zA-Z] + )(. *)\. html $ "/category. php? Id = $1 & brand = $2 & page = $3 & sort = $4 & order = $5 last;
Rewrite "^/category-([0-9] +)-B ([0-9] +)-([0-9] + )(. *)\. html $ "/category. php? Id = $1 & brand = $2 & page = $3 last;
Rewrite "^/category-([0-9] +)-B ([0-9] +) (. *) \. html $"/category. php? Id = $1 & brand = $2 last;
Rewrite "^/category-([0-9] +) (. *) \. html $"/category. php? Id = $1 last;
Rewrite "^/goods-([0-9] +) (. *) \. html"/goods. php? Id = $1 last;
Rewrite "^/article_cat-([0-9] +)-([0-9] + )-(. +)-([a-zA-Z] + )(. *)\. html $ "/article_cat.php? Id = $1 & page = $2 & sort = $3 & order = $4 last;
Rewrite "^/article_cat-([0-9] +)-([0-9] +) (. *) \. html $"/article_cat.php? Id = $1 & page = $2 last;
Rewrite "^/article_cat-([0-9] +) (. *) \. html $"/article_cat.php? Id = $1 last;
Rewrite "^/article-([0-9] +) (. *) \. html $"/article. php? Id = $1 last;
Rewrite "^/brand-([0-9] +)-c ([0-9] +)-([0-9] + )-(. +)-([a-zA-Z] + )\. html "/brand. php? Id = $1 & cat = $2 & page = $3 & sort = $4 & order = $5 last;
Rewrite "^/brand-([0-9] +)-c ([0-9] +)-([0-9] + )(. *)\. html "/brand. php? Id = $1 & cat = $2 & page = $3 last;
Rewrite "^/brand-([0-9] +)-c ([0-9] +) (. *) \. html"/brand. php? Id = $1 & cat = $2 last;
Rewrite "^/brand-([0-9] +) (. *) \. html"/brand. php? Id = $1 last;
Rewrite "^/tag-(. *) \. html"/search. php? Keywords = $1 last;
Rewrite "^/snatch-([0-9] +) \. html $"/snatch. php? Id = $1 last;
Rewrite "^/group_buy-([0-9] +) \. html $"/group_buy.php? Act = view & id = $1 last;
Rewrite "^/auction-([0-9] +) \. html $"/auction. php? Act = view & id = $1 last;
Rewrite "^/exchange-id ([0-9] +) (. *) \. html $"/exchange. php? Id = $1 & act = view last;
Rewrite "^/exchange-([0-9] +)-min ([0-9] +)-max ([0-9] +) -([0-9] + )-(. +)-([a-zA-Z] + )(. *)\. html $ "/exchange. php? Cat_id = $1 & integral_min = $2 & integral_max = $3 & page = $4 & sort = $5 & order = $6 last;
Rewrite ^/exchange-([0-9] +)-([0-9] + )-(. +)-([a-zA-Z] + )(. *)\. html $ "/exchange. php? Cat_id = $1 & page = $2 & sort = $3 & order = $4 last;
Rewrite "^/exchange-([0-9] +)-([0-9] +) (. *) \. html $"/exchange. php? Cat_id = $1 & page = $2 last;
Rewrite "^/exchange-([0-9] +) (. *) \. html $"/exchange. php? Cat_id = $1 last;
}

SHOPEX pseudo-static rulesCopy codeThe Code is as follows: location /{
If (! -E $ request_filename ){
Rewrite ^/(. + \. (html | xml | json | htm | php | jsp | asp | shtml) $/index. php? $1 last;
}
}

Discuz 7 pseudo-static rulesCopy codeThe Code is as follows: rewrite ^/archiver/(fid | tid)-[\ w \-] + \. html) $/archiver/index. php? $1 last;
Rewrite ^/forum-([0-9] +)-([0-9] +) \. html $/forumdisplay. php? Fid = $1 & page = $2 last;
Rewrite ^/thread-([0-9] +)-([0-9] +)-([0-9] +) \. html $/viewthread. php? Tid = $1 & extra = page \ % 3D $3 & page = $2 last;
Rewrite ^/space-(username | uid)-(. +) \. html $/space. php? $1 = $2 last;
Rewrite ^/tag-(. +) \. html $/tag. php? Name = $1 last;

Author: Zhu MahaI

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.