Local website copy

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Local website copy

Postby 1eye » 20. November 2017 00:41

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.
1eye
 
Posts: 2
Joined: 19. November 2017 17:08
XAMPP version: 7.1.11b
Operating System: Windows 10

Re: Local website copy

Postby Altrea » 20. November 2017 01:08

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.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Local website copy

Postby 1eye » 20. November 2017 02:36

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,
1eye
 
Posts: 2
Joined: 19. November 2017 17:08
XAMPP version: 7.1.11b
Operating System: Windows 10

Re: Local website copy

Postby nieve1 » 01. October 2018 00:46

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
nieve1
 
Posts: 11
Joined: 23. September 2018 04:17
XAMPP version: 7.2.9
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 132 guests