微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决无法登录且样式不适用于 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 举报,一经查实,本站将立刻删除。