2012-07-04 37 views
0

我正在嘗試將/imgs/blue.gif中的靜態文件請求重寫爲/files/images/spacer.gif,但似乎無法使其工作。Nginx重寫Drupal中的靜態內容的規則

我試圖把後續的行成/位置「try_files $ URI @rewrite」前:

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

我也嘗試過將它添加到@rewrite位置「改寫^ /(。 *)$ /index.php?q=$1;「線路,但是這也不起作用。

希望有人能夠幫助我做到這一點。

P.S:我使用Drupal和有類似這樣的設置我的配置文件:http://wiki.nginx.org/Drupal

回答

0

檢查您的網站配置。

Here is an example of working Nginx configuration > 我把我的重定向中庸之道根聲明是這樣後:

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

如果它不工作,檢查錯誤日誌,並發表您的配置。