Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

http://magento.local reverts to live site - Magento and Xampp for OSX

I'm having trouble trying to rebuild my dev environment.

I've installed XAMPP and followed these steps:

  1. Backup MYSQL DB.
  2. Backup Home Directory.
  3. Create DB with same user/dbname
  4. Imported SQL file successfully, and imported home directory (and invisible files) into htdocs.
  5. Verified that base_url and secure_base_url are set to "http://magento.local" (I have tried http://127.0.0.1, also)
  6. Deleted all Cache/Sessions

How can i get http://magento.local to just display my local website, instead of reverting to the live URL?

I have edited my base_urls, and even the cookie url.

like image 662
danchet Avatar asked Nov 14 '11 23:11

danchet


4 Answers

Magento is loading, noting that the URL you're using is not the same as what's configured, and redirecting you.

Here are the steps to edit the base URL in the Magento config.

I'm guessing you need to clear the Magento cache mentioned there.

like image 195
tkrajcar Avatar answered Nov 15 '22 12:11

tkrajcar


The way I always do it is as follows...

Search the core_config_data table for ANY fields that are URLs, which you can do by running...

SELECT * FROM core_config_data WHERE value LIKE 'http%'

..or simply using phpMyAdmin if you have it available. One of our main sites has a total of about 8 rows to be updated (possibly not all required, could be left from older versions it was running on). If you see your live URL simply change it out for your local address.

Then open you cache folder and delete any files starting with mage--*. The thing that normally ends up catching me out at this point is file permissions. I don't know what OS you are using, so I can't tell you how to check, but if the apache user doesn't have write permissions to the cache folder the first time you accessed the site, Magento creates most of the files normally created in the DOCUMENT_ROOT/var folder in the OS's temp directory. For example, we use Mac OSX at work, it will create the cache files in /tmp/magento/, upon deleting that directory you should be good to go.

NB: You should probably update the file permssions of the var directory before viewing the site again, otherwise it will keep writing to the temp directory, which will trip you up again in the future.

like image 28
Peter O'Callaghan Avatar answered Nov 15 '22 11:11

Peter O'Callaghan


Have you checked your htaccess file?

like image 21
tuze Avatar answered Nov 15 '22 12:11

tuze


If your local magento store url is like http://magento/ then your Magento dont work, but if your url is like http://magento.local/ - magento store will be working fine.

like image 42
Siaržuk Piatroŭski Avatar answered Nov 15 '22 12:11

Siaržuk Piatroŭski