2

I have a static html website in a folder on Windows XP. If I open the file directly from its location, the page loads in a browser, but none of the relative links work. They all want to be relative to localhost, not the directory they're in.

I can drop the project in IIS and it works fine, but I'd like to be able to skip that step and just browse the project without needing a server.

But my question is simply this: is there something I can do so I can view the website locally, through a browser, without a server?

Thanks.

Brett
  • 2,675
  • 4
  • 25
  • 32
  • Have you tried: Save Page As (Webpage, complete) when viewing it on a server? – Diodeus - James MacFarlane Jun 06 '12 at 20:17
  • The whole story is that I'm building the site in rails, then using wget to make a pure html version of the site. So, in my folder is a complete web app, with html files, stylesheets, javascripts, and images. It's all there. – Brett Jun 06 '12 at 20:21

1 Answers1

1

<base> Defines the base URL or target for all relative links. It goes in the <head> tag.

It can also be useful for developers who build websites in one location (dev) that will ultimately be placed in another location (prod).

<base href="http://myfolder/test/"> 

There is some discussion -- and some more examples for you -- in this SO question.

Community
  • 1
  • 1
DOK
  • 31,405
  • 7
  • 58
  • 91