【发布时间】:2014-03-05 00:11:25
【问题描述】:
我刚刚将 Laravel 构建部署到临时服务器,但我的图像文件夹的 URL 存在问题。
我的本地开发环境中不存在此问题。
两台服务器上的图像都位于 www_root/public/img/ 中,并且页面源中的 /img/xxxx.jpg 被引用
如上所述,这一切都在本地开发中正常工作,但在我的暂存环境中却没有,并且找不到图像。
在暂存环境中,如果我将图像链接更改为 /public/img/xxxx.jpg,则会找到它们,但如果我对本地开发人员执行此操作,则会破坏图像参考。
www_root 的 htaccess 包含:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# Rewrite to 'public' folder
RewriteCond %{HTTP_HOST} ^dev.domain.com$ #on the staging environment, this is updated accordingly
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) public/$1 [L]
</IfModule>
我已经相应地更新了我的 application/config/application.php 文件。
除了以上 2 个环境之间的变化,其他一切都完全一样。
我看不到其他地方可能存在问题。
有什么想法吗?
【问题讨论】: