开发者社区> 问答> 正文

主机宝,求转换个骑士招聘的静态规则

74cms的静态规则是Apache的,求转换nginx的



RewriteEngine On
RewriteBase /
# Rewrite规则


RewriteRule ^index\.htm$ index\.php


RewriteRule ^jobs/jobs-show-([0-9]+)\.htm$ jobs/jobs-show\.php\?id=$1
RewriteRule ^jobs/jobs-list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ jobs/jobs-list\.php\?category=$1&subclass=$2&district=$3&sdistrict=$4&settr=$5&trade=$6&wage=$7&nature=$8&scale=$9&inforow=$10&sort=$11&key=$12&page=$13
RewriteRule ^jobs/jobs-contrast-(.*)\.htm$ jobs/jobs-contrast\.php\?id=$1
RewriteRule ^jobs/map-search-([0-9]+)\.htm$ jobs/map-search\.php\?id=$1
RewriteRule ^jobs/jobtag-search-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ jobs/jobtag-search\.php\?category=$1&subclass=$2&district=$3&sdistrict=$4&jobtag=$5&inforow=$6&page=$7
RewriteRule ^jobs/street-search-(.*)-(.*)-(.*)-(.*).htm$ jobs/street-search\.php\?streetid=$1&sort=$2&inforow=$3&page=$4
RewriteRule ^jobs/officebuilding-search-(.*)-(.*)-(.*)-(.*).htm$ jobs/officebuilding-search\.php\?officebuildingid=$1&sort=$2&inforow=$3&page=$4


RewriteRule ^company/company-list-(.*)-(.*)-([0-9]+)\.htm$ company/index\.php\?trade=$1&inforow=$2&page=$3
RewriteRule ^company/company-show-([0-9]+)\.htm$ company/company-show\.php\?id=$1
RewriteRule ^company/company-jobs-([0-9]+)-([0-9]+)\.htm$ company/company-jobs\.php\?id=$1&page=$2
RewriteRule ^company/company-comment-([0-9]+)-([0-9]+)\.htm$ company/company-comment\.php\?id=$1&page=$2
RewriteRule ^company/company-comment-show-([0-9]+)\.htm$ company/company-comment-show\.php\?id=$1
RewriteRule ^company/company-img-([0-9]+)-([0-9]+)\.htm$ company/company-img\.php\?id=$1&page=$2
RewriteRule ^company/company-news-([0-9]+)-([0-9]+)\.htm$ company/company-news\.php\?id=$1&page=$2
RewriteRule ^company/company-news-show-([0-9]+)\.htm$ company/company-news-show\.php\?id=$1


RewriteRule ^resume/resume-show-([0-9]+)\.htm$ resume/resume-show\.php\?id=$1
RewriteRule ^resume/resume-list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ resume/resume-list\.php\?category=$1&subclass=$2&district=$3&sdistrict=$4&experience=$5&education=$6&sex=$7&photo=$8&talent=$9&inforow=$10&sort=$11&key=$12&page=$13
RewriteRule ^resume/resumetag-search-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ resume/resume-search\.php\?category=$1&subclass=$2&district=$3&sdistrict=$4&resumetag=$5&inforow=$6&page=$7


RewriteRule ^news/news-list-([0-9]+)-([0-9]+)\.htm$ news/news-list\.php\?id=$1&page=$2
RewriteRule ^news/news-search-(.*)-([0-9]+)\.htm$ news/news-search\.php\?key=$1&page=$2
RewriteRule ^news/news-show-([0-9]+)\.htm$ news/news-show\.php\?id=$1


RewriteRule ^explain/explain-show-([0-9]+)\.htm$ explain/explain-show\.php\?id=$1


RewriteRule ^notice/notice-list-([0-9]+)-([0-9]+)\.htm$ notice/notice-list\.php\?id=$1&page=$2
RewriteRule ^notice/notice-show-([0-9]+)\.htm$ notice/notice-show\.php\?id=$1


RewriteRule ^hrtools/hrtools-list-([0-9]+)\.htm$ hrtools/hrtools-list\.php\?id=$1


RewriteRule ^jobfair/jobfair-list-([0-9]+)\.htm$ jobfair/jobfair-list\.php\?page=$1
RewriteRule ^jobfair/jobfair-show-([0-9]+)\.htm$ jobfair/jobfair-show\.php\?id=$1
RewriteRule ^jobfair/jobfair-exhibitors-([0-9]+)-([0-9]+)\.htm$ jobfair/jobfair-exhibitors\.php\?id=$1&page=$2


RewriteRule ^simple/simple-list-(.*)-(.*)-([0-9]+)\.htm$ simple/simple-list\.php\?key=$1&keytype=$2&page=$3
RewriteRule ^simple/simple-show-([0-9]+)\.htm$ simple/simple-show\.php\?id=$1


RewriteRule ^help/help-list-([0-9]+)-([0-9]+)\.htm$ help/help-list\.php\?id=$1&page=$2
RewriteRule ^help/help-search-(.*)-([0-9]+)\.htm$ help/help-search\.php\?key=$1&page=$2
RewriteRule ^help/help-show-([0-9]+)\.htm$ help/help-show\.php\?id=$1

展开
收起
我也是名人 2014-07-21 00:35:10 10208 0
2 条回答
写回答
取消 提交回答
  • 您好,观察到您的 www.dawangqiao.com 没有解析到云服务器,如果解析后不能访问确认一下有没有接入阿里云。


    Nginx规则(没有经过测试,您放上去看下):
    rewrite ^/index.htm$ /index.php last;
    rewrite ^/jobs/jobs-show-([0-9]+).htm$ /jobs/jobs-show.php?id=$1 last;
    rewrite ^/jobs/jobs-list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ /jobs/jobs-list.php?category=$1&subclass=$2&district=$3&sdistrict=$4&settr=$5&trade=$6&wage=$7&nature=$8&scale=$9&inforow=$10&sort=$11&key=$12&page=$13 last;
    rewrite ^/jobs/jobs-contrast-(.*).htm$ /jobs/jobs-contrast.php?id=$1 last;
    rewrite ^/jobs/map-search-([0-9]+).htm$ /jobs/map-search.php?id=$1 last;
    rewrite ^/jobs/jobtag-search-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ /jobs/jobtag-search.php?category=$1&subclass=$2&district=$3&sdistrict=$4&jobtag=$5&inforow=$6&page=$7 last;
    rewrite ^/jobs/street-search-(.*)-(.*)-(.*)-(.*).htm$ /jobs/street-search.php?streetid=$1&sort=$2&inforow=$3&page=$4 last;
    rewrite ^/jobs/officebuilding-search-(.*)-(.*)-(.*)-(.*).htm$ /jobs/officebuilding-search.php?officebuildingid=$1&sort=$2&inforow=$3&page=$4 last;
    rewrite ^/company/company-list-(.*)-(.*)-([0-9]+).htm$ /company/index.php?trade=$1&inforow=$2&page=$3 last;
    rewrite ^/company/company-show-([0-9]+).htm$ /company/company-show.php?id=$1 last;
    rewrite ^/company/company-jobs-([0-9]+)-([0-9]+).htm$ /company/company-jobs.php?id=$1&page=$2 last;
    rewrite ^/company/company-comment-([0-9]+)-([0-9]+).htm$ /company/company-comment.php?id=$1&page=$2 last;
    rewrite ^/company/company-comment-show-([0-9]+).htm$ /company/company-comment-show.php?id=$1 last;
    rewrite ^/company/company-img-([0-9]+)-([0-9]+).htm$ /company/company-img.php?id=$1&page=$2 last;
    rewrite ^/company/company-news-([0-9]+)-([0-9]+).htm$ /company/company-news.php?id=$1&page=$2 last;
    rewrite ^/company/company-news-show-([0-9]+).htm$ /company/company-news-show.php?id=$1 last;
    rewrite ^/resume/resume-show-([0-9]+).htm$ /resume/resume-show.php?id=$1 last;
    rewrite ^/resume/resume-list-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ /resume/resume-list.php?category=$1&subclass=$2&district=$3&sdistrict=$4&experience=$5&education=$6&sex=$7&photo=$8&talent=$9&inforow=$10&sort=$11&key=$12&page=$13 last;
    rewrite ^/resume/resumetag-search-(.*)-(.*)-(.*)-(.*)-(.*)-(.*)-(.*).htm$ /resume/resume-search.php?category=$1&subclass=$2&district=$3&sdistrict=$4&resumetag=$5&inforow=$6&page=$7 last;
    rewrite ^/news/news-list-([0-9]+)-([0-9]+).htm$ /news/news-list.php?id=$1&page=$2 last;
    rewrite ^/news/news-search-(.*)-([0-9]+).htm$ /news/news-search.php?key=$1&page=$2 last;
    rewrite ^/news/news-show-([0-9]+).htm$ /news/news-show.php?id=$1 last;
    rewrite ^/explain/explain-show-([0-9]+).htm$ /explain/explain-show.php?id=$1 last;
    rewrite ^/notice/notice-list-([0-9]+)-([0-9]+).htm$ /notice/notice-list.php?id=$1&page=$2 last;
    rewrite ^/notice/notice-show-([0-9]+).htm$ /notice/notice-show.php?id=$1 last;
    rewrite ^/hrtools/hrtools-list-([0-9]+).htm$ /hrtools/hrtools-list.php?id=$1 last;
    rewrite ^/jobfair/jobfair-list-([0-9]+).htm$ /jobfair/jobfair-list.php?page=$1 last;
    rewrite ^/jobfair/jobfair-show-([0-9]+).htm$ /jobfair/jobfair-show.php?id=$1 last;
    rewrite ^/jobfair/jobfair-exhibitors-([0-9]+)-([0-9]+).htm$ /jobfair/jobfair-exhibitors.php?id=$1&page=$2 last;
    rewrite ^/simple/simple-list-(.*)-(.*)-([0-9]+).htm$ /simple/simple-list.php?key=$1&keytype=$2&page=$3 last;
    rewrite ^/simple/simple-show-([0-9]+).htm$ /simple/simple-show.php?id=$1 last;
    rewrite ^/help/help-list-([0-9]+)-([0-9]+).htm$ /help/help-list.php?id=$1&page=$2 last;
    rewrite ^/help/help-search-(.*)-([0-9]+).htm$ /help/help-search.php?key=$1&page=$2 last;
    rewrite ^/help/help-show-([0-9]+).htm$ /help/help-show.php?id=$1;

    -------------------------

    回 3楼(我也是名人) 的帖子
    客气了,百度DNS推出不久,也许还有待改进吧。
    2014-07-21 01:59:38
    赞同 展开评论 打赏
  • Re主机宝,求转换个骑士招聘的静态规则
    另外我的http://www.dawangqiao.com/怎么打不开啊!同样的http://www.dawangzhen.cn/能打开

    2014-07-21 00:37:54
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
商业流量的精准在线分配 立即下载
代码未写,漏洞已出——谈谈设计不当导致的安全问题 立即下载
代码未写,漏洞已出 立即下载