cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 CSS not loading, admin link is not accessible

Magento 2.4 CSS not loading, admin link is not accessible

Hi All,

I am pretty new to Magento

I installed Magento 2.4 on Debian11 OS.

link http://<Sever_IP>/magento displays magento home page, but without formatting, and also non of the links there work, for example if you click in the login link, it says 404: Page not found.

 

Tried all the below but not working:

- Enabled rewriting

- Fixed the permissions and ownership as in the installation guide.

- Deployed static content, cleared and flushed magento cache as well

 

also the admin link is not working. Any ideas welcomed.  Screenshot 2021-09-18 002831.pngThe admin_<xxxxx> also not working 

 

 

3 REPLIES 3

Re: Magento 2.4 CSS not loading, admin link is not accessible

@firassalladebd 

You need to give permission to var generated pub/static using the following command:
chmod -R 777 var generated pub/static
Then pass the deploy command
php bin/magento setup:static-content:deploy -f
If still the issue is not gets resolved then:
Put the .htaccess with URL rewrite option in the pub/static directory.
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.

Re: Magento 2.4 CSS not loading, admin link is not accessible

Hello Sanjay,

Thanks for your reply.

 

This wasn't the reason. The reason was that during the setup, I declared my Base URL without referring to the installation root folder correctly, and this mistake could happen to anyone who is new to Magento Smiley Happy I am not shy about it as this was my first setup, and Adobe quick start installation isn't that much clear Smiley Happy

 

So for example if you have configure Magento root to be on /var/www/html/magento, and your ServerName in Apache2.conf file is x.x.x.x, then when you install Magento 2 at the final step you should select the below as your base URL:

http://x.x.x.x/Magento

 

 

Re: Magento 2.4 CSS not loading, admin link is not accessible

My solution was to check the path for CSS file. First of all i inspect the page and find CSS URL are not correct. It has static sign content. I first disable it. Then regenerate the static content and clear cache. Now CSS will be visible

Anees