OECMS在Nginx服务器下的伪静态规则

2020-12-01 10:00

本帖最后由 etopia 于 2011-12-12 12:27 编辑

Nginx服务器已经成为主流服务器,被各大服务器提供商所应用,oecms官方目前只提供iis和apache服务器伪静态规则,需要转一下,已经转好的,测试成功,服务器环境Linux+Nginx,伪静态规则如下:
支持模式一和模式二
rewrite ^/index\.html$ /index.php last;
    rewrite ^/contact\.html$ /page.php?mod=contact last;
    rewrite ^/about\.html$ /page.php?mod=about last;
    rewrite ^/sitemap\.html$ /page.php?mod=sitemap last;
    rewrite ^/link\.html$ /page.php?mod=link last;
    rewrite ^/page-([0-9]+)\.html$ /page.php?mod=detail&id=$1 last;
    rewrite ^/guestbook\.html$ /guestbook.php last;
    rewrite ^/info\.html$ /info.php last;
    rewrite ^/product\.html$ /product.php last;
    rewrite ^/case\.html$ /case.php last;
    rewrite ^/solution\.html$ /solution.php last;
    rewrite ^/article\.html$ /article.php last;
    rewrite ^/download\.html$ /download.php last;
    rewrite ^/job\.html$ /job.php last;
    rewrite ^/info-([0-9]+)\.html$ /info.php?mod=detail&id=$1 last;
    rewrite ^/info-cat-([0-9]+)\.html$ /info.php?mod=list&cid=$1 last;
    rewrite ^/info-page-([0-9]+)\.html$ /info.php?mod=list&page=$1 last;
    rewrite ^/info-cat-([0-9]+)-([0-9]+)\.html$ /info.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/article-([0-9]+)\.html$ /article.php?mod=detail&id=$1 last;
    rewrite ^/article-cat-([0-9]+)\.html$ /article.php?mod=list&cid=$1 last;
    rewrite ^/article-page-([0-9]+)\.html$ /article.php?mod=list&page=$1 last;
    rewrite ^/article-cat-([0-9]+)-([0-9]+)\.html$ /article.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/product-([0-9]+)\.html$ /product.php?mod=detail&id=$1 last;
    rewrite ^/product-cat-([0-9]+)\.html$ /product.php?mod=list&cid=$1 last;
    rewrite ^/product-page-([0-9]+)\.html$ /product.php?mod=list&page=$1 last;
    rewrite ^/product-cat-([0-9]+)-([0-9]+)\.html$ /product.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/solution-([0-9]+)\.html$ /solution.php?mod=detail&id=$1 last;
    rewrite ^/solution-cat-([0-9]+)\.html$ /solution.php?mod=list&cid=$1 last;
    rewrite ^/solution-page-([0-9]+)\.html$ /solution.php?mod=list&page=$1 last;
    rewrite ^/solution-cat-([0-9]+)-([0-9]+)\.html$ /solution.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/case-([0-9]+)\.html$ /case.php?mod=detail&id=$1 last;
    rewrite ^/case-cat-([0-9]+)\.html$ /case.php?mod=list&cid=$1 last;
    rewrite ^/case-page-([0-9]+)\.html$ /case.php?mod=list&page=$1 last;
    rewrite ^/case-cat-([0-9]+)-([0-9]+)\.html$ /case.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/job-([0-9]+)\.html$ /job.php?mod=detail&id=$1 last;
    rewrite ^/job-cat-([0-9]+)\.html$ /job.php?mod=list&cid=$1 last;
    rewrite ^/job-page-([0-9]+)\.html$ /job.php?mod=list&page=$1 last;
    rewrite ^/job-cat-([0-9]+)-([0-9]+)\.html$ /job.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/download-([0-9]+)\.html$ /download.php?mod=detail&id=$1 last;
    rewrite ^/download-cat-([0-9]+)\.html$ /download.php?mod=list&cid=$1 last;
    rewrite ^/download-page-([0-9]+)\.html$ /download.php?mod=list&page=$1 last;
    rewrite ^/download-cat-([0-9]+)-([0-9]+)\.html$ /download.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/contact$ /page.php?mod=contact last;
    rewrite ^/about$ /page.php?mod=about last;
    rewrite ^/sitemap$ /page.php?mod=sitemap last;
    rewrite ^/link$ /page.php?mod=link last;
    rewrite ^/page/([0-9]+)\.html$ /page.php?mod=detail&id=$1 last;
    rewrite ^/guestbook$ /guestbook.php last;
    rewrite ^/info$ /info.php last;
    rewrite ^/product$ /product.php last;
    rewrite ^/case$ /case.php last;
    rewrite ^/solution$ /solution.php last;
    rewrite ^/article$ /article.php last;
    rewrite ^/download$ /download.php last;
    rewrite ^/job$ /job.php last;
    rewrite ^/info/([0-9]+)\.html$ /info.php?mod=detail&id=$1 last;
    rewrite ^/info/cat-([0-9]+)\.html$ /info.php?mod=list&cid=$1 last;
    rewrite ^/info/page-([0-9]+)\.html$ /info.php?mod=list&page=$1 last;
    rewrite ^/info/cat-([0-9]+)-([0-9]+)\.html$ /info.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/article/([0-9]+)\.html$ /article.php?mod=detail&id=$1 last;
    rewrite ^/article/cat-([0-9]+)\.html$ /article.php?mod=list&cid=$1 last;
    rewrite ^/article/page-([0-9]+)\.html$ /article.php?mod=list&page=$1 last;
    rewrite ^/article/cat-([0-9]+)-([0-9]+)\.html$ /article.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/product/([0-9]+)\.html$ /product.php?mod=detail&id=$1 last;
    rewrite ^/product/cat-([0-9]+)\.html$ /product.php?mod=list&cid=$1 last;
    rewrite ^/product/page-([0-9]+)\.html$ /product.php?mod=list&page=$1 last;
    rewrite ^/product/cat-([0-9]+)-([0-9]+)\.html$ /product.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/solution/([0-9]+)\.html$ /solution.php?mod=detail&id=$1 last;
    rewrite ^/solution/cat-([0-9]+)\.html$ /solution.php?mod=list&cid=$1 last;
    rewrite ^/solution/page-([0-9]+)\.html$ /solution.php?mod=list&page=$1 last;
    rewrite ^/solution/cat-([0-9]+)-([0-9]+)\.html$ /solution.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/case/([0-9]+)\.html$ /case.php?mod=detail&id=$1 last;
    rewrite ^/case/cat-([0-9]+)\.html$ /case.php?mod=list&cid=$1 last;
    rewrite ^/case/page-([0-9]+)\.html$ /case.php?mod=list&page=$1 last;
    rewrite ^/case/cat-([0-9]+)-([0-9]+)\.html$ /case.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/job/([0-9]+)\.html$ /job.php?mod=detail&id=$1 last;
    rewrite ^/job/cat-([0-9]+)\.html$ /job.php?mod=list&cid=$1 last;
    rewrite ^/job/page-([0-9]+)\.html$ /job.php?mod=list&page=$1 last;
    rewrite ^/job/cat-([0-9]+)-([0-9]+)\.html$ /job.php?mod=list&cid=$1&page=$2 last;
    rewrite ^/download/([0-9]+)\.html$ /download.php?mod=detail&id=$1 last;
    rewrite ^/download/cat-([0-9]+)\.html$ /download.php?mod=list&cid=$1 last;
    rewrite ^/download/page-([0-9]+)\.html$ /download.php?mod=list&page=$1 last;
    rewrite ^/download/cat-([0-9]+)-([0-9]+)\.html$ /download.php?mod=list&cid=$1&page=$2 last;

[attach]324[/attach]

6267 次浏览 5 条评论 收藏

说说我的看法

登录后可以发表评论 登录
5个评论
-- 2020-12-01 10:00
iis的呢?找不到啊
回复
-- 2020-12-01 10:00
非常感谢,支持
回复
-- 2020-12-01 10:00
老大你这个代码是放到哪里的?
回复
-- 楼主 2020-12-01 10:00
uknow 发表于 2011-12-16 14:06 static/image/common/back.gif
辛苦了。

客气了。
回复
-- 2020-12-01 10:00
辛苦了。
回复
作者信息

3
贴子
0
粉丝
热门贴子

免费试用


咨询热线


在线咨询