anai1943
V2EX  ›  Apache

.htaccess 动态参数不确定的写法

  •  
  •   anai1943 · Jun 3, 2015 · 2582 views
    This topic created in 3997 days ago, the information mentioned may be changed or developed.

    动态url:/index.php?m=product&c=index&a=list&cid=3&attr-1=客户端&attr-2=进口&attr-3=游戏运营&page=1
    希望重写成:/c-3_a1-客户端_a2-进口_a3-游戏运营_p-1.html
    其中:attr-1,attr-2,attr-3这几个参数是不确定的,有可能不出现,有可能出现几个,这种情况,rewrite规则怎么写呢?多谢

    1 replies    2015-06-03 18:48:35 +08:00
    jarlyyn
        1
    jarlyyn  
       Jun 3, 2015
    这个为啥归 .htaccess管……

    理论上应该就是按秩序取,没有就留空。

    但实际上个人觉得是router的事
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3859 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 04:27 · PVG 12:27 · LAX 21:27 · JFK 00:27
    ♥ Do have faith in what you're doing.