代码之家  ›  专栏  ›  技术社区  ›  James

Lighttpd url重写删除查询字符串变量

  •  0
  • James  · 技术社区  · 16 年前

    url.rewrite-once = (
    "^/(.*)\.(.+)$" => "$0",
    "^/(.+/?)\??$" => "/index.php?q=$1"
    )
    

    http://mydomain.com/account/edit?user=5 我在index.php上的脚本

    q=account/edit?user=5
    

    在apache上,我将获得所有变量,即。

    q=account/edit   AND
    user=5
    

    如何在Lighttpd中保留变量?

    1 回复  |  直到 16 年前
        1
  •  4
  •   Shtirlic    16 年前

    试着这样做:

      "^/something/(\d+)(?:\?(.*))?" => "/index.php?bla=$1&$2" 
    

    还是这个

        "^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
      "^/([^.?]*)$" => "/index.php?q=$1"