theyettihunta Posted January 2, 2014 Posted January 2, 2014 Question: If i clone a web page that contains links to other web pages will they still work? -For example, i clone an index.html. -the real index.html has links to other pages on the site. - i am redirecting my network's taffic to my clone of index.html that is on my pc - if a machine on my network clicks a link on my cloned page will the machine still resort to public dns and go to the speficif web page online? Quote
digip Posted January 2, 2014 Posted January 2, 2014 Depends on if the links are relative links vs absolute links, and you are also cloning the linked files locally. ie: the page cloned when loaded locally may look funky, if for instance the style sheet is linked relatively - such as "/css/style.css" and if that file is not copied with the same URL path, then its not going to load the CSS file, images, embedded files, etc. You'd have to clone all the linked files as well for it to look the same. Absolute links that point to external data, pages or sites, will take you to the real site when clicked, so if you're trying to do something local with the file and have everything load from your clone only, then you need to also re-write all the URL's for cloned files to point locally or served from wherever you are saving the files from. As for the DNS lookups, if it sees an absolute URL for the site in the cloned file that is an external resource, ie: real site links, its going to default to do a DNS lookup for the resource at the real location so you'd have to re-write all the URL's to be local to your cloned files. Not sure exactly what you are trying to do, but there are tools for cloning local copies of sites and crawling/spidering linked pages as well to save them locally with all file resources. One of the easiest tools to learn is wget, which can save a copy of a site locally and you can force it to clone the files linked relatively in the page and create the directories of files for you. Quote
theyettihunta Posted January 2, 2014 Author Posted January 2, 2014 Thanks Digip, thats exactly what i was looking for wget is great. Got another similar thread comin atchya... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.