无法登录且样式不适用于 Laravel 应用

问题描述

我在 ovh 服务器上部署了一个 Laravel 应用程序,但遇到了几个问题。

样式不适用,所以我的所有网站都有原始渲染。我有这种错误

GET https://www.mysite/public/js/app.js net::ERR_ABORTED 404

GET https://www.mysite/public/css/app.css net::ERR_ABORTED 404

这是我的 .htaccess 文件,如果您需要其他相关内容,请告诉我。

/转换器

<FilesMatch ".env|.gitattributes|.gitignore|artisan|composer.json|composer.lock|cron.bat|image.json|package.json|package-lock.json|PHPunit.xml|webpack.mix.js">
Order allow,deny
Deny from all
</FilesMatch>

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]

    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.PHP

</IfModule>

/转换器/公共

<FilesMatch ".env|.gitattributes|.gitignore|artisan|composer.json|composer.lock|cron.bat|image.json|package.json|package-lock.json|PHPunit.xml|webpack.mix.js">
Order allow,deny
Deny from all
</FilesMatch>

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ ^$1 [N]

    RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
    RewriteRule ^(.*)$ public/$1

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.PHP

    RewriteCond %{HTTPS} off [OR]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteCond %{HTTP_HOST} ^(.*)$  [NC]
    RewriteRule (.*) https://www.%1/$1 [R=301,L]

   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ /index.PHP?/$1 [L]

    RewriteCond %{THE_REQUEST} ^GET.*index\.PHP [NC]
    RewriteRule (.?)index\.PHP/(.*) /$1$2 [R=301,NE,L]

</IfModule>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)