JDavies
JDavies

Reputation: 2770

Megento dev site re-directing to live site URL

I'm having a huge issue with accessing my dev site. I two magentos sites on different servers. One is the dev site, the other live. However I needed to copy the database from the live to the dev site.

Ever since i did this i've had problems with accessing the dev URL. As it keeps re-directing me to the live site. I've googled the issue and tried the following:

  • Accessed the 'core_config_date' and changed the unsecure/BASE_URL & secure/base_url and changed them back to the dev URL.
  • I then went to clear the cache on the dev site, which had already been cleared from when i was installing a plugin.
  • Set everything to 0 in 'core_cache_option'.
  • Cleared cache on my browser
  • But i'm still getting the issue of the site re-directing to the live URL.

    I've noticed a few people had had the same problem, but the above solution doesn't seem to be working for me. Any help would be much appreciated.

    Thanks

    Upvotes: 1

    Views: 110

    Answers (3)

    Fiasco Labs
    Fiasco Labs

    Reputation: 6457

    Check your file permissions and set them properly so Magento doesn't end up creating a MagicCache in the system /tmp folder which is where your core configs are being cached, allowing for you to clear var/cache till the end of time and have the settings in the database never take.

    All over here Can't change Magento base URL -> Stuck in cache

    Upvotes: 0

    JDavies
    JDavies

    Reputation: 2770

    Right so managed to sort it. It was a permissions issue. I overlooked it as I didn't have a linux user setup for this site. However the folder user was set to 'root' as opposed to 'www-data'.

    For anyone with this issue in the future, I strongly recommend checking permissions on the server/folder for caching.

    Steps to fix the issue:

  • Change base URL in the 'core_config_data' table (can be found on line 5 or 6, give or take)
  • Check permissions on your siteroot/var folder. Delete everything from /var/session & /var/cache
  • Run 'chown websiteuser -R siteroot' and then 'chmod u+w -R siteroot' for permissions changes.
  • That should be enough to get it working.

    Upvotes: 4

    Maniprakash Chinnasamy
    Maniprakash Chinnasamy

    Reputation: 2776

    Do the below steps in your development server :

    1) Check the development server database hostname,username, password in your config.xml file in below path : app/etc/.

    2) Open your live server database in any editor and find the live site url entirely. and replace with your development server url with searched result.

    above two steps will solve your issues. here after it will now solve.

    3) Check your .htaccess file in your root folder to check the any redirection rule.

    Upvotes: 0

    Related Questions