fantasts
V2EX  ›  问与答

这份规则如何写成 nginx 规则

  •  
  •   fantasts · Mar 22, 2015 · 2385 views
    This topic created in 4069 days ago, the information mentioned may be changed or developed.

    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 replies    2015-03-23 12:31:32 +08:00
    Septembers
        1
    Septembers  
       Mar 22, 2015   ❤️ 2
    fantasts
        2
    fantasts  
    OP
       Mar 23, 2015
    @Septembers 转换出来是没用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1037 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 18:32 · PVG 02:32 · LAX 11:32 · JFK 14:32
    ♥ Do have faith in what you're doing.