【发布时间】:2018-12-05 22:08:18
【问题描述】:
我有一个带有Apache2 的全新虚拟服务器。我正在尝试开始我的Laravel 5.5 项目。
它在我的 Homestead 环境中运行良好,但在此服务器上却无法运行。
我正在使用这个 apache 配置:
<VirtualHost *:80>
ServerName www.myproject.com
ServerAlias myproject.com new.myproject.com
ServerAdmin webmaster@myadmin.com
DocumentRoot /var/www/www.myproject.com/current/public
CustomLog /var/www/www.myproject.com/log/access.log vhost_combined
ErrorLog /var/www/www.myproject.com/log/error.log
RewriteEngine On
LogLevel alert rewrite:trace3
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /var/www/www.myproject.com/current/public/index.php [L]
<Directory />
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>
<Directory /var/www/www.myproject.com/current/public>
Options FollowSymLinks MultiViews
Require all granted
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
现在主页已经加载好了,但是如果我点击登录或注册菜单,它会显示一个 Laravel 处理和基于 Blade 模板的页面,但是 CSS、JS 和图像没有加载。文件位于 public/ 文件夹中的位置,它们不是空大小的,并且仍然没有加载。
如果我点击登录页面,登录页面显示的不是这些文件(css、js、图像)...
有人知道吗?
【问题讨论】:
标签: laravel .htaccess mod-rewrite apache2