V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
fantasts
V2EX  ›  问与答

这份规则如何写成 nginx 规则

  •  
  •   fantasts · 2015-03-22 03:54:54 +08:00 · 1927 次点击
    这是一个创建于 3294 天前的主题,其中的信息可能已经有所发展或是发生改变。

    index.php?xiami={id}
    index.php?xiamiplayer={id}
    index.php?m163={id}
    index.php?m163player={id}
    index.php?ttpod={songname}
    index.php?ttpodplayer={songname}
    index.php?kugou={songname}
    index.php?kugouplayer={songname}

    .htaccess下是这么写的
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^xiami/(\d)[\/][.mp3]$ index.php?xiami=$1 [NC]
    RewriteRule ^xiamiplayer/(\d
    )[\/][.mp3]$ index.php?xiamiplayer=$1 [NC]
    RewriteRule ^m163/(\d)[\/][.mp3]$ index.php?m163=$1 [NC]
    RewriteRule ^m163player/(\d
    )[\/][.mp3]$ index.php?m163player=$1 [NC]
    RewriteRule ^ttpod/(.+?)[\/][.mp3]$ index.php?ttpod=$1 [NC]
    RewriteRule ^ttpodplayer/(.+?)[\/][.mp3]$ index.php?ttpodplayer=$1 [NC]
    RewriteRule ^kugou/(.+?)[\/][.mp3]$ index.php?kugou=$1 [NC]
    RewriteRule ^kugouplayer/(.+?)[\/][.mp3]$ index.php?kugouplayer=$1 [NC]
    </IfModule>

    如何写成nginx 的规则呢

    2 条回复    2015-03-23 12:31:32 +08:00
    Septembers
        1
    Septembers  
       2015-03-22 06:27:46 +08:00   ❤️ 2
    fantasts
        2
    fantasts  
    OP
       2015-03-23 12:31:32 +08:00
    @Septembers 转换出来是没用
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1167 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:29 · PVG 02:29 · LAX 11:29 · JFK 14:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.