Page 1 of 1

Local website copy

PostPosted: 20. November 2017 00:41
by 1eye
I have recently learned (I am a newbie) that web hosts generally will not allow links that point directly to a user's machine. That is for security reasons - to not allow unwanted access to the local machine. For that reason links that exist inside my website can only use IP to access my other areas of my website, and all accesses to it are with respect to my public domain's root directory. If I copy my whole website to c:\xampp\htdocs, as soon as I click on a link that is supposed to refer to the local copy, the live site gets used instead.

Is there not any way to make xamp use a local file whenever a reference to my domain is encountered (referenced by executing xamp code)? That way I could keep a local copy of my whole site, and use only the local copy for tests? Please forgive me if this is a stupid question. I am trying to have a local copy of my entire site, and not use the live site for testing.

Re: Local website copy

PostPosted: 20. November 2017 01:08
by Altrea
You could create a Windows HOSTS entry that points your domain name to your very local machine 127.0.0.1

Or you change all links from absolute urls to relative ones.

Re: Local website copy

PostPosted: 20. November 2017 02:36
by 1eye
Thank you. I think this is working OK. I just have to change my hosts file back to the real domain, and I go live again,

Re: Local website copy

PostPosted: 01. October 2018 00:46
by nieve1
Hi,
What would be the proper syntax to jump back to original point where the link has been defined. That's what I have in my html:

<p> <a href="#mbmuerte">Mario Benedetti</a></p>

Further down I have this statement:

<p id="mbmuerte">LLEGASTE temprano

How do I include a link so that I go back to the line where I came from ( where the <a href= is ).
Thank you Altrea