14

I have installed magento 2 successfully but frontend side and admin side style is not loading. Even after login to admin it gives not found(404) pageenter image description here

Base url in core_config_data:http://localhost.com/magento2/

7

Please validate, if your webserver uses the correct rewrites.

For Apache: allow the loading of htaccess files and usage of rewrite rules.

for nginx, use the example config provided in the magento directory.

  • 1
    I have to enable the rewrite_module of apache. After doing that my style sheet was loaded.So to all you need to enable rewrite_module – Bhupendra Jadeja Dec 27 '14 at 9:01
  • enable the rewrite_module of apache works for me thanks +1 from me @Flyingmanna – Keyur Shah May 5 '15 at 5:40
3

First of all, View the source of your page and click the css links, if it is pointed correctly it should bring you to the css page.

Please check whether you have changed Home page design from Admin Panel.

I mean go to Cms >> Pages

Open Home Page.

Click on Design tab.

Check value of "Custom Theme" under "Custom Design".

If still you find any trouble, then please provide your website's URL.

  • It does not allow me to login to backend – Bhupendra Jadeja Dec 27 '14 at 8:53
2

run command on Magento Root

php dev/tools/Magento/Tools/View/deploy.php

OR

Go to

dev/tools/Magento/Tools/View/ location and run command

php deploy.php
  • I have only path up to this location magentoroot\dev\tools\Magento\Tools , in short missing view/location folder. what should i do ? – GuRu Feb 5 '16 at 14:53
1

You need to deploy content
run this command in magento root directory

 sudo php bin/magento setup:static-content:deploy
1

I had the same issue(stylesheet not loading) but it was caused by something else.

I had changed the URLs of my website in the database and forgot to leave a "/" at the end of the url.

what I had:

http://www.example.com

https://www.example.com

what it should be:

http://www.example.com/

http://www.example.com/

clear cache after using the command below when in the root folder of your Magento 2 installation

php bin/magento cache:status
0

You have to provide full permission to the "pub" folder, Try to run the following command on Magento root.

chmod -R 777 pub
0

I had issues with this as well, but none of the above solutions were working. Some guides recommending this order of commands.

from Magento root directory

rm -r var/cache/ var/view_preprocessed
php bin/magento setup:static-content:deploy

Note from one of the answers above I believe there is no need to use sudo in front of either of those commands above. Your user should have proper permissions and the file directories should be setup properly with ownership.

What I found works for this issue is to actually either make a backup of or remove entirely rm -r pub/static or make it a backup mv pub/static pub/static.bak Then do the content deploy php bin/magento setup:static-content:deploy and then clear your browser cache (use extension to just do it on that page) and reload your page.

rm -r pub/static
php bin/magento setup:static-content:deploy
0

if you're on Apache

sudo vim /etc/apache2/apache2.conf and update AllowOverride to all for the /var/www Directory

then go to your document root (where magento code resides) and

rm -rf var directory (the one that contains the cached files)
sudo php bin/magento setup:static-content:deploy –f
php bin/magento indexer:reindex (optional)
0

I've been battling with this for 5 days now. Finally solved the issue. There are three possible errors:

  1. Your version number is showing in your css path.
  2. Your static files are not deployed.
  3. Both 1 & 2 are the case.

To solve 1: Go to your mysql and type insert into core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0).

To solve 2: From your magento project root, run php bin/magento setup:static-content:deploy --force.

Remember to clean your cache for each case. php bin/magento cache:clean config

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.