Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

[SOLVED] Css js files not loading #37

Closed
ugintl opened this issue Sep 25, 2021 · 1 comment
Closed

[SOLVED] Css js files not loading #37

ugintl opened this issue Sep 25, 2021 · 1 comment

Comments

@ugintl
Copy link

ugintl commented Sep 25, 2021

It is working locally, but when I upload the files on a shared hosting, the css and js files are not loading. I see it like this

billingtrack

@ugintl
Copy link
Author

ugintl commented Sep 26, 2021

I solved it. I created a .htaccess file in the root of the laravel app. I just had to add RewriteRule ^(.*)$ public/$1 [L]. See below

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

    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)$ public/$1 [L]
    # 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>

@ugintl ugintl changed the title Css js files not loading [SOLVED] Css js files not loading Sep 27, 2021
@cytech cytech closed this as completed Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants