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/


10 Answers 10


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 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

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 Dec 27 '14 at 8:53

run command on Magento Root

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


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

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

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

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:



what it should be:



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

php bin/magento cache:status

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

chmod -R 777 pub

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

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)

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


INSERT INTO core_config_data (path, value) VALUES ('dev/static/sign', 0) ON DUPLICATE KEY UPDATE value = 0;

After that run this commands

sudo php bin/magento cache:clean
sudo php bin/magento cache:flush

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.