【问题标题】:Nginx rewrite rule for static content in DrupalDrupal中静态内容的Nginx重写规则
【发布时间】:2012-07-04 07:14:00
【问题描述】:

我正在尝试将静态文件请求从 /imgs/blue.gif 重写为 /files/images/spacer.gif,但似乎无法正常工作。

我尝试将以下行放入“try_files $uri @rewrite”之前的 / 位置:

rewrite ^/imgs/blue.gif  /files/images/spacer.gif permanent;

我还尝试将它添加到“rewrite ^/(.*)$ /index.php?q=$1;”之前的@rewrite 位置行,但这也没有用。

希望有人能在这方面帮助我。

P.S.:我正在使用 Drupal,并设置了与此类似的配置文件:http://wiki.nginx.org/Drupal

【问题讨论】:

    标签: drupal nginx rewrite


    【解决方案1】:

    检查您的网站配置。

    Here is an example of working Nginx configuration > 我将重定向放在根声明之后,如下所示:

    rewrite ^/address_to_intercept http://mysite.com/address_to_go permanent;
    

    如果它不起作用,请检查您的错误日志并发布您的配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-02
      • 2010-11-05
      • 1970-01-01
      • 2010-11-20
      相关资源
      最近更新 更多