Moving Magento2 from one sub-folder to another sub-folder in same domain displaying 404 error everywhere except home-page. Admin is also displaying 404 error.

Steps to produce:

  1. Copy all files from one folder to another-folder
  2. Created new db and imported from current db
  3. Updated database details in new sub-folder/app/etc/env.php (Only database name is changed).
  4. Modify the value of web/unsecure/base_url and web/secure/base_url in core_config_data table
  5. Clear cache and also tried to changed mode from production to developer and vica versa.

Magento version: 2.1.3

  • You need to deploy static content – Pankaj Sharma Mar 23 '17 at 7:25
  • Require to update Magento path where you create domain. now your site get old Magento folder path. – Emipro Technologies Pvt. Ltd. Apr 5 '18 at 10:25

Use steps, I think it will help you.

  1. pub/static/ remove all files except .htaccess
  2. var/cache/ remove all files
  3. Run setup upgrade command
  4. Change pub & var permission 777
  5. Run sudo php bin/magento setup:static-content:deploy
  6. Run cache clear & flush commands
  7. Change pub & var permission 777
| improve this answer | |

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.