我已经启动了一个位于Laravel
中的网站,该网站的链接为this。如果您使用任何笔记本电脑打开网站都可以,但是如果您使用任何mobile browser (chrome)
打开网站,则CSS
和image files
不会加载。
这是我在app.blade.php
中加载CSS文件的方式。谁能指出我想念的东西或我需要做什么?我尝试清除缓存,从其他手机浏览过。
<link href="{{ asset('css/style.css') }}" rel="stylesheet">
<link href="{{ asset('css/responsive.css') }}" rel="stylesheet">
<link href="{{ asset('css/custom.css') }}" rel="stylesheet">
Routes / web.php
Route::get('/', 'CustomerController@index')->name('homepage');
Route::get('/gahans-vision', 'CustomerController@aboutus')->name('aboutus');
.htacess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^gahancollections\.com [NC]
RewriteRule ^(.*)$ http://www.gahancollections.com/$1 [R=301,NC]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
答案 0 :(得分:2)
因此,问题出在URL。如果您尝试打开http://gahancollections.com,它将无法正常工作。请注意,URL没有www
。而且,现在,如果您在浏览器中打开http://www.gahancollections.com,它将可以使用。因此,问题应该出在您的routes/web.php
文件中。
请添加您的routes/web.php
文件内容,以便我们准确回答。
答案 1 :(得分:0)
我过去曾遇到过此问题,请尝试在没有asset
助手的情况下加载样式,如下所示:
<link href="/css/style.css" rel="stylesheet">
<link href="/css/responsive.css" rel="stylesheet">
<link href="/css/custom.css" rel="stylesheet">
/
很重要。