Eugh, i'm honestly banging my ahead against the brick wall with this.
I have my Magento site hosted on the localhost so that I can make changes without affecting the live site. Everything works perfectly EXCEPT none of the links seem to be working. If I click anything on the site, nothing even attempts to load.
Backend loads fine, but the frontend links won't work at all.
Any ideas? Pleaaaaase.
UPDATE: My unsecure site Base URL shows: http://127.0.0.1:8888/magento/
My secure site Base URL shows the same: http://127.0.0.1:8888/magento/
I access the frontend of my store by visiting: http://127.0.0.1:8888/magento/ or http://127.0.0.1:8888/magento/index.php/
And I access the bankend of my store by visitng:http://127.0.0.1:8888/magento/index.php/admin
Best Answer
Alan Kent posted a great article recently on Magento 2 behavior similar to what you describe that linked to this Stack Overflow discussion, but the key concepts are relevant to 1.X as well since it's more generally about cookie implementation logic not specific to Magento's codebase.
In short, the fundamental implementation of cookie handling logic has some requirements included within it to check for the presence of certain attributes of a domain name:
Thus, the best way to configure your local development environment to make sure you see behavior similar to your live environments is to update your hosts file to map a domain, any domain, to your local system, as long as it has a format of
xxx.yyy.zzz
<- includes two 'dots' in the domain nameWe've adopted a process of adding something like the following for sites we develop to our hosts file to make sure we don't have to fight with this kind of problem:
127.0.0.1 dev.somesite.com
127.0.0.1 dev.someothersite.com
After doing this, the odd behavior you describe no longer happens in our dev environments and we can get back to coding :)
You may still need to perform one of these two approaches to troubleshoot this kind of issue to make sure you create the correct local host entry in your hosts file:
If you have a (your_database_system) client that can connect to the database you're using, open it and run the following query:
select * from core_config_data where path like '%base%url%';
On my mySQL system I can open up MySQL Workbench and see something like the following:
Since you can also login to your Magento Admin back-end, you can also try browsing to the following menu option:
System -> Configuration -> Web
which should display the following page.Expand the Unsecure and Secure accordions and you should look for the fields marked
Unsecure : Base URL
andSecure : Base URL
:Add what you see in the
Unsecure : Base URL
andSecure : Base URL
fields along with the URL your browser is displaying when you access the back-end and front end in the comments and we can figure out what's happening and a way to restore your functionality: