谁能把Apache规则直接转换成Nginx规则

查看 20|回复 1
作者:快备-我黑凤梨   
[I]
    RewriteEngine On
    AddDefaultCharset UTF-8
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^search/(.*)$ /index.php?c=index&m=search&keywords=$1 [L,QSA]
    RewriteRule ^download.html$ /index.php?c=index&m=high_speed_download [L,QSA]
    RewriteRule ^info/([0-9]+).html$ /index.php?c=index&m=info_list&last_cate_id=$1 [L,QSA]
    RewriteRule ^game/([0-9]+).html$ /index.php?c=index&m=game_list&cate_id=$1 [L,QSA]
    RewriteRule ^soft/([0-9]+).html$ /index.php?c=index&m=soft_list&cate_id=$1 [L,QSA]
    RewriteRule ^necessary/([0-9]+).html$ /index.php?c=index&m=necessary_list&necessary_type=$1 [L,QSA]
    RewriteRule ^games/([0-9]+).html$ /index.php?c=index&m=game_more&cate_id=$1 [L,QSA]
    RewriteRule ^softs/([0-9]+).html$ /index.php?c=index&m=soft_more&cate_id=$1 [L,QSA]
    RewriteRule ^map.html$ /index.php?c=index&m=site_map [L,QSA]
    RewriteRule ^searchs.html$ /index.php?c=index&m=page_search [L,QSA]
    RewriteRule ^xcode.html$ /index.php?c=index&m=xcode [L,QSA]
    RewriteRule ^rank.html$ /index.php?c=index&m=list_rank [L,QSA]
    RewriteRule ^special.html$ /index.php?c=index&m=list_special [L,QSA]
    RewriteRule ^info.html$ /index.php?c=index&m=list_info [L,QSA]
    RewriteRule ^necessary.html$ /index.php?c=index&m=list_necessary [L,QSA]
    RewriteRule ^game.html$ /index.php?c=index&m=list_game [L,QSA]
    RewriteRule ^soft.html$ /index.php?c=index&m=list_soft [L,QSA]
    RewriteRule ^category/([0-9]+).html$ /index.php?c=index&m=list_category&cate_id=$1 [L,QSA]
    RewriteRule ^comment/([0-9]+).html$ /index.php?c=index&m=comment&app_id=$1 [L,QSA]
    RewriteRule ^qrcode/([0-9]+).html$ /index.php?c=index&m=qrcode&app_id=$1 [L,QSA]
    RewriteRule ^recommend/([0-9]+).html$ /index.php?c=index&m=list_recommend&id=$1 [L,QSA]
    RewriteRule ^download/([0-9]+).html$ /index.php?c=index&m=download&app_id=$1 [L,QSA]
    RewriteRule ^special/([0-9]+).html$ /index.php?c=index&m=content_special&special_id=$1 [L,QSA]
    RewriteRule ^news/([0-9]+).html$ /index.php?c=index&m=content_info&info_id=$1 [L,QSA]
    RewriteRule ^softs.html$ /index.php?c=index&m=more_soft [L,QSA]
    RewriteRule ^games.html$ /index.php?c=index&m=more_game [L,QSA]
    RewriteRule ^app/([0-9]+).html$ /index.php?c=index&m=content_app&app_id=$1 [L,QSA]
[/I]
谁能把上面的Apache规则直接转换成Nginx规则

规则, 谁能

艾特   
试试这个,不行的话问AI
[ol]
  • # nginx configuration by 01022.hk
  • if (!-f $request_filename){
  •     set $rule_0 1$rule_0;
  • }
  • if (!-d $request_filename){
  •     set $rule_0 2$rule_0;
  • }
  • if ($rule_0 = "21"){
  • rewrite ^/search/(.*)$ /index.php?c=index&m=search&keywords=$1 last;
  • }
  • rewrite ^/download.html$ /index.php?c=index&m=high_speed_download last;
  • rewrite ^/info/([0-9]+).html$ /index.php?c=index&m=info_list&last_cate_id=$1 last;
  • rewrite ^/game/([0-9]+).html$ /index.php?c=index&m=game_list&cate_id=$1 last;
  • rewrite ^/soft/([0-9]+).html$ /index.php?c=index&m=soft_list&cate_id=$1 last;
  • rewrite ^/necessary/([0-9]+).html$ /index.php?c=index&m=necessary_list&necessary_type=$1 last;
  • rewrite ^/games/([0-9]+).html$ /index.php?c=index&m=game_more&cate_id=$1 last;
  • rewrite ^/softs/([0-9]+).html$ /index.php?c=index&m=soft_more&cate_id=$1 last;
  • rewrite ^/map.html$ /index.php?c=index&m=site_map last;
  • rewrite ^/searchs.html$ /index.php?c=index&m=page_search last;
  • rewrite ^/xcode.html$ /index.php?c=index&m=xcode last;
  • rewrite ^/rank.html$ /index.php?c=index&m=list_rank last;
  • rewrite ^/special.html$ /index.php?c=index&m=list_special last;
  • rewrite ^/info.html$ /index.php?c=index&m=list_info last;
  • rewrite ^/necessary.html$ /index.php?c=index&m=list_necessary last;
  • rewrite ^/game.html$ /index.php?c=index&m=list_game last;
  • rewrite ^/soft.html$ /index.php?c=index&m=list_soft last;
  • rewrite ^/category/([0-9]+).html$ /index.php?c=index&m=list_category&cate_id=$1 last;
  • rewrite ^/comment/([0-9]+).html$ /index.php?c=index&m=comment&app_id=$1 last;
  • rewrite ^/qrcode/([0-9]+).html$ /index.php?c=index&m=qrcode&app_id=$1 last;
  • rewrite ^/recommend/([0-9]+).html$ /index.php?c=index&m=list_recommend&id=$1 last;
  • rewrite ^/download/([0-9]+).html$ /index.php?c=index&m=download&app_id=$1 last;
  • rewrite ^/special/([0-9]+).html$ /index.php?c=index&m=content_special&special_id=$1 last;
  • rewrite ^/news/([0-9]+).html$ /index.php?c=index&m=content_info&info_id=$1 last;
  • rewrite ^/softs.html$ /index.php?c=index&m=more_soft last;
  • rewrite ^/games.html$ /index.php?c=index&m=more_game last;
  • rewrite ^/app/([0-9]+).html$ /index.php?c=index&m=content_app&app_id=$1 last;
  • [/ol]复制代码
  • 您需要登录后才可以回帖 登录 | 立即注册

    返回顶部