Local version of site redirecting automatically to live site
Permalink
I've just setup an existing site for a client it's running version 5.5.2.1 and when I set it up locally every page automatically redirects me to the online version. I've edit the config.php to remove the base_path, or change it to localhost and neither affected things. I checked the htaccess. I searched the database for the url, it's in there but only in block tables, nothing that would seem to affect redirection. No sign of any packages that do this like a redirect on login or anything.
I am really stumped as to where this site could possible be getting the full url and then redirecting.
I am really stumped as to where this site could possible be getting the full url and then redirecting.
Good suggestion but no it would not be a mystery to me if the URL was hardcoded somewhere. It literally did not exist. However, I used the URL as the folder name locally as in the-site.com. And I left the constant DIR_REL in config. And it seemed, not sure how, that this caused some problems. No matter how I changed BASE_PATH or .htaccess I got either duplication or missing base path or the most strange, forwarding away from localhost to the live site.
Removing DIR_REL and BASE_PATH fixed this issue. I looked at sites I'd setup locally before, none of them had either DIR_REL or BASE_PATH but in .htaccess the RewriteBase is set to /site_root_folder/. This is using WAMP.
Hopefully this helps somebody if their taking a live site and then setting it up locally.
Removing DIR_REL and BASE_PATH fixed this issue. I looked at sites I'd setup locally before, none of them had either DIR_REL or BASE_PATH but in .htaccess the RewriteBase is set to /site_root_folder/. This is using WAMP.
Hopefully this helps somebody if their taking a live site and then setting it up locally.
Yep I would never have thought of that. Good catch :)
Looks like what's left is to search all the files for some hard coded thing containing the address