I have installed Magento 2.4.2 in ubuntu, but after the installation process when I run the front and backend URL, it's not working properly,

I have installed Magento 2.4.2 using the command line.

PHP 7.4 version,

enter image description here

enter image description here

please help me with this issue, I have tried everything possible ways but it's not resolved yet. thanks.

  • Check module rewrite enabled or not.
    – Amit Saini
    Mar 3 '21 at 10:16
  • open 404 error link in new tab and remove "verson161476..." slug and check it's working in new tab or not Mar 3 '21 at 11:42

Run below commands :

  1. sudo php bin/magento setup:static-content:deploy
  2. sudo php bin/magento c:c
  • i have run all command 3 times but no changes are done.
    – rocky9310
    Mar 3 '21 at 10:02
  • even i checked permission also, all persmissions are correct
    – rocky9310
    Mar 3 '21 at 10:03
  • Try sudo php bin/magento setup:upgrade sudo php bin/magento c:f Mar 3 '21 at 10:05

Try to run below commands:

sudo php bin/magento sampledata:reset
sudo php bin/magento setup:upgrade
sudo php bin/magento cache:flush

Ensure that your webserver document root is configured correctly. It should be serving Magento from magento_root_folder/pub.

For more information see the following official documentation:


  1. symlink

Create symlink of pub/media and pub/static directory in root.

ln -s /{path}/pub/media /{path}/media

ln -s /{path}/pub/static /{path}/static


ln -s /var/www/html/m242/pub/media /var/www/html/m242/media

ln -s /var/www/html/m242/pub/static /var/www/html/m242/static

  • don't remove .htaccess file from pub/static Folder. Mar 10 '21 at 12:36
  • No, there is no need to remove .htaccess file from pub/static Folder. Mar 11 '21 at 4:57

set base url in core_config_data in magento db -

UPDATE core_config_data SET value='http://localhost/magento242/pub/' WHERE path='web/unsecure/base_url';

This works for me.

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.