Search code examples
htmlhyperlinkweblocalfile-sharing

Trouble linking local html files together


I have been working on a local website for awhile now, but I can't figure out how to link the html files I have created together so that viewers on other computers can click through them like a website.

I am building the site on my own computer, but have two other people who I want to send the files to. I can link the html pages together so they click through fine on my computer, but when I send them to the other people, the links don't work.

I imagine this is just a simple solution, but I can't seem to find it anywhere. Any help is much appreciated.


Solution

  • (1) Assuming you have all html files in a single folder, e.g. "somefolder" and you used

    <a href="C:\somepath\somefolder\filename.html">

    to reference other html files, then just replace it with a relative path:

    <a href="filename.html">

    (2) If you sent the pack of html pages as an archive, then it has to be extracted completely for links to work.