【发布时间】:2013-12-12 07:35:15
【问题描述】:
我的 drupal 站点位于 example.com,为了在本地系统中进行配置,我创建了一个新文件夹 drupal 并将所有文件粘贴到该文件夹中。
当我在 /localhost/drupal 加载我的网站时,它的加载但图像没有加载,因为它指向内容中的 /localhost/sites/default/files/test.jpg...我不能去改变在所有内容中...
现在设置 .htaccess 将所有图像路径带到 /localhost/drupal/sites/default/files/test.jpg
<img alt="" src="/sites/default/files/finsoft-logo.png" style="width: 164px; height: 45px; ">
我试过这样,但它不是 wokring
RewriteRule ^/sites/default/files/(.*)$ /drupal/sites/default/files/$1 [L,NC]
以下是我在 .htaccess 文件中的代码
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}
请帮我解决这个问题...
【问题讨论】: