Support

Akeeba Backup for Joomla!

#31521 Restoring a Backup to a Local MAMP Server on Windows - Stop 'localhost' redirection to live site

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Friday, 09 August 2019 17:17 CDT

martinix
Please look at the bottom of this page (under Support Policy Summary) for our support policy summary, containing important information regarding our working hours and our support policy. Thank you!

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 2Mb, please upload it on your server and post a link to it.

Description of my issue:

Hi - to support further development and testing of our site, we restored a backup of our current live Joomla site to a local desktop MAMP Pro 4.1 server. Restore worked fine and we can access the Joomla Administrator component and backend on the desktop MAMP 'localhost'. The problem we have is that when we browse to the front-end, 'localhost' the site just redirects to the live site 'https://mylivesite.com'. In attempting to remedy this we have:

1.) turned off SEF Friendly URLs
2.) disabled the .htaccess file
3.) checked the Akeeba Admin Tools feature to disable 'Redirect www and non-www addresses'
4.) removed the Hostname from the System Configuration in the Admin Tools .htaccess maker
5.) created a new .htaccess file from the Akeeba Admin Tools with setting above

Both with and without the .htaccess, a browser request to 'localhost' continues to redirect to the live site. We have checked that all browser caches etc. have been cleared and we've removed any SEO related extensions and checked the Template for mods. We've been unable to locate anything that might be causing the site to redirect. Our remaining thought is that possibly some of the full, live-site, URL information is held within the database.

We appreciate this is probably not a direct Akeeba Admin/Backup problem but we'd welcome any advice you might have to help us understand how to prevent the 'localhost' copy redirecting to the 'live-site'.

Many thanks.

Martin..

dlb
Martin,

I'm very impressed! You found almost everything that could redirect the site. I think the one you missed is the $LiveSite variable in configuration.php. You can edit configuration.php and make that variable an empty string, I think that will fix the problem.

Just for your information, the $LiveSite variable is not normally needed by Joomla!. It is only required in special circumstances where the server doesn't report the live URL properly to an inquiry. Your live site would most likely work without the address there as well.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

martinix
Thanks Dale. Interesting I did check that configuration.php file in the root directory and the $LiveSite variable was already set to empty. As written..

public $live_site = '';

I can't find any other locations/references to the $LiveSite variable.

I'll try setting the $LiveSite setting to 'localhost' and see what happens.

dlb
If $Live_Site is empty, it isn't the problem.

Is the front end going directly to the live site or does it display local, then go to live? I took one of my sites local recently that had hard coded URLs in the menu items (a VERY special case). That did what you're describing. Do you have any extensions that might have the site URL in their configuration settings? I wouldn't expect that to send the whole site to the live URL.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

martinix
Ok. Yes. I confirm that it is not $Live_Site causing the problem.

I've been using JSiteMap Pro to assist with SEO performance. I guess it is possible that this may be causing the problem. As part of my investigations, I did remove it from the 'localhost' installation but I guess it is possible that JSiteMap may have hard-coded some of the URLs?

I'll see what I can do to find out more.

martinix
Found it!

The problem was I had used the System - Aimy Canonical (PRO) plugin to force the domain name/https connection. Disabling this plug-in fixed the problem.

Sorry to have troubled you and thank you for your advice.

dlb
You're welcome! I'm glad you got it figured out.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!