【问题标题】:Converting .htaccess to nginx?将 .htaccess 转换为 nginx?
【发布时间】:2015-06-18 06:40:54
【问题描述】:

以下是.htaccess,

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

我使用了 winginx 来获取 nginx 重写,即,

rewrite ^/(.+)$ /index.php?url=$1 last;

但它没有达到预期的效果。

原网址为:http://xxxx/foo/info/getinfo/123/

转换后的网址应为: http://xxx/foo/index.php?url=info/getinfo/123/

【问题讨论】:

    标签: .htaccess nginx


    【解决方案1】:

    已修复!改成下面这个

    rewrite ^/foo/(.*)$ /foo/index.php?url=$1 break;
    

    【讨论】:

      猜你喜欢
      • 2018-07-10
      • 2017-08-02
      • 2011-05-07
      • 1970-01-01
      • 2013-02-02
      • 2015-05-21
      • 2011-11-25
      相关资源
      最近更新 更多