【问题标题】:need help to convert htaccess rule to nginx需要帮助将 htaccess 规则转换为 nginx
【发布时间】:2015-06-29 07:15:24
【问题描述】:

谁能帮我将以下 .htaccess 规则转换为 nginx。

重写引擎开启

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} .jpg -f

重写规则 ^(.*)$ $1.jpg

谢谢

【问题讨论】:

    标签: .htaccess nginx php


    【解决方案1】:

    使用这个,适用于大多数规则:http://winginx.com/en/htaccess

    # nginx configuration 
    location / 
    { 
       if (!-e $request_filename)
       { 
          rewrite ^(.*)$ /$1.jpg; 
       } 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-03-16
      • 2011-04-16
      • 1970-01-01
      • 2020-05-29
      • 2015-02-17
      • 2017-07-15
      • 2015-09-09
      相关资源
      最近更新 更多