I'll start off with saying that I am new to Magento. After installing Magento I only receive 404's. There is no styling either. I can't access the admin panel or anything, I just see "whoops, our bad...". I have been looking around for answers but nothing has worked.

So far I have tried:

php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento cache:flush

Changing a few things in my .htaccess (RewriteBase)

I'm not sure what could be the issue now. Any help would be greatly appreciated! If any other information I will edit it in.

Extra info:

  • Host: Webfaction
  • Server: Apache 2.4.6
  • Php: 5.6.31
  • OS: CentOS (7 I believe)

Thank you in advance!

update: I am unable to leave comments because you need 50 rep to leave a comment? Sadly I am unable to recompile due to our allotted memory through the host. Is it possible that uninstalling and reinstalling magento could solve the issue?

update 2: I was able to do both solutions and neither worked sadly.

  • Which folder are you in? And what modifications made inside .htaccess?
    – PY Yick
    Aug 11, 2017 at 2:32

4 Answers 4


Thank you all for the replies and the help! But it turned out to be a pretty simple fix that I just didn't realize. I was installing to the base url example.com/magento2/ but there was no magento2 folder. So it was 404'ing. I then just uninstalled and did the base url as example.com and now it works!


Looks like your Magento application was switched to production mode, that's why static files are not accessible.

There are two solutions:

  1. Deploy static files: bin/magento setup:static-content:deploy
  2. Switch to developer mode: bin/magento deploy:mode:set developer

As for 404 for admin panel - make sure you are using correct admin path (can be found in app/etc/env.php)

Also give full permission to your root magento directory.

chmod -R 777 /var/www/html/MAGENTO_2_ROOT_DIRECTORY/
  • That's wrong , never ever give 777 to magento root directory it will open all the backdoors for attacks Feb 15, 2022 at 18:42

This may cause two things

1) check mod_write enabled in your server. if not enable also check allowoverride is all in apache server.

2) You can remove the folders from the directory with:

rm -rf var/cache var/generation var/pagecache var/di

and then re-compile again

 bin/magento setup:di:compile
 bin/magento setup:static-content:deploy

Hope it will helpful for you.


you try this all command i hope your problem solve it and no any change so you remove your var folder after try this command.

php bin/magento setup:static-content:deploy php bin/magento cache:clean php bin/magento cache:flush chmod -R 777 /var/www/html/MAGENTO_2_ROOT_DIRECTORY set permission/ php bin/magento index:reindex

  • 777 permission is not suggested in any case. Feb 15, 2022 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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