Magento localhost installation Invalid Base URL

Posted by Damodar Bashyal on December 01, 2011

 

I was installing magento on localhost so i can test different magento extensions. But on configuration page I was getting error for base url as below:

The URL "http://www.magento.ag.com/" is invalid.
Response from server isn't valid.

The URL "http://www.magento.local/" is invalid.
Response from server isn't valid.

The URL "http://localhost/" is invalid.
Response from server isn't valid.

Note: I was trying with different urls but all failed. At last found one solution.

Update this file: app/code/core/Mage/Install/Model/Installer/config php

replace line:

$prefix = $secure ? 'install/wizard/checkSecureHost/' : 'install/wizard/checkHost/';

with:

$prefix = $secure ? 'index.php/install/wizard/checkSecureHost/' : 'index.php/install/wizard/checkHost/';


or,
replace line:

$client = new Varien_Http_Client($url.$prefix);

with:

$client = new Varien_Http_Client($url.'index.php/'.$prefix);


NOTE: newer versions of magentos already got this fix but still I was getting same error.

Finally, the live saver trick was to check the checkbox of option:
=> Skip Base URL Validation Before the Next Step

Then, everything worked as I wanted.

ohoo!

Felipe Miranda posted on - Wednesday 24th of August 2016 06:38:03 AM

I was able to fix it by editing /etc/hosts and set ip and hostnames

nandeesh posted on - Wednesday 30th of August 2017 11:49:43 AM

sir, Iam accessing magento from my local host using XAMPP. Earlier I was accessing my magento admin panel successfully. But by mistake I changed my base address from localhost to www.embeddedelectronics.in. now Iam not getting the magento admin login page, but I am getting an error page from www.embeddedelectronics.in/magento2/...........
I need to change it to localhost, so that the localhost login url will be http://localhost/magento2/

so my doubt is how to change the base address back to localhost?
 
not published on website


QR Code: Magento localhost installation Invalid Base URL