laravel找不到css和js
我已将我的项目上载到共享主机,但css和js文件无法下载 我正在使用AdminLte主题,AdminLte的文件夹位于公用文件夹中 .htaccess文件的内容(laravel找不到css和js,css,laravel,laravel-5,Css,Laravel,Laravel 5,我已将我的项目上载到共享主机,但css和js文件无法下载 我正在使用AdminLte主题,AdminLte的文件夹位于公用文件夹中 .htaccess文件的内容(public/.htaccess) 选项-多视图-索引 重新启动发动机 #句柄授权头 RewriteCond%{HTTP:Authorization}。 重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}] #如果不是文件夹,则重定向尾部斜杠。。。 重写cond%{REQUEST_FILENAME}-D
public/.htaccess
)
选项-多视图-索引
重新启动发动机
#句柄授权头
RewriteCond%{HTTP:Authorization}。
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]
#如果不是文件夹,则重定向尾部斜杠。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_URI}(+)/$
重写规则^1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
这是我在项目文件夹中创建的.htaccess文件
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /public/$1
#RewriteRule ^ index.php [L]
RewriteRule ^(/)?$ public/index.php [L]
</IfModule>
选项+FollowSymLinks
重新启动发动机
重写cond%{REQUEST_URI}^/公众/
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$/public/$1
#重写规则^index.php[L]
重写规则^(/)?$public/index.php[L]
出现以下错误:
为什么有两个独立的
.htaccess
文件?要从URL中删除public,RewriteRule^(.*)$/public/$1
不应该是RewriteRule^(.*)public/$1
以使路径相对吗?我在类似这样的地方找到了它,但无论我如何更改它,都不会更改相同的东西,请检查一下,也许这对你有帮助。谢谢:)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /public/$1
#RewriteRule ^ index.php [L]
RewriteRule ^(/)?$ public/index.php [L]
</IfModule>