Magento 2.4.2 – How to Run Without Creating Virtualhost

http-error-404magento2.4.2migrate

I install Magento 2.4.2 but I have got 404 page not found, please give any suggestions for run M2.4.2 without a virtual host because I want to work on multiple Magento at a time so the virtual host is not suitable for me.

Best Answer

Yes, you can run Magento without virtual host. for this follow these steps

  1. keep your magento root directory inside /var/www/html like this /var/www/html/your_magento_directory
  2. then inside core_config_data define your url as localhost/your_magento_directory/pub OR 127.0.0.1/your_magento_directory/pub
  3. then go to your browser and write same path like http://localhost/your_magento_directory/pub

Now check your Magento is running successfully.

Note: in older versions of Magento you don't need to hit pub folder just give path till Magento root directory and you Magento will be working fine. because in older version index.php file is in root directory and in later versions index.php file is inside pub folder.

Related Topic