Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After I type "localhost" in my browser the index.html successfully loads. However any to the links on that website appear to be dead. Once clicked, nothing happens. I see the right path in the path bar (using Chrome). However nothing happens, not even a message error. I run Apache 2.0 on Windows 7. The test configuration does not give any error messages.

I went through Apache website, I downloaded a book on Apache and I searched the internet. Any pointers what Im doing wrong?

share|improve this question
Are you receiving 404 pages, or is the URL actually a hash href="#"? – Moses Apr 4 '13 at 14:02
Not receiving 404 pages. This is an example of the URL <A href="file:///C:/Websites/VBA_Code_Header.html">Code Header</A><BR> Not sure what URL being a hash means. – PBD10017 Apr 4 '13 at 14:06
The issues was in the URL itself. I should use "http" instead of "file", not sure why, but it works. – PBD10017 Apr 4 '13 at 14:10
It generally looks cleaner if you specify the root directory of the webserver and then use something such as ./index.html to navigate to other html docs. – cutrightjm Apr 4 '13 at 14:40
up vote 2 down vote accepted

Based on your comment where your URLs are using file:/// paths, this is the reason.

Because you're presumably using an WAMP stack (Windows, Apache, MySQL, [PHP][Perl][etc.]) installed on your machine, it acts a server, so you will need to call actual URLs with the Hypertext Transfer Protocol, rather than disk file paths.

If you had called the file absolutely from the disk, ie, file:///C:/Websites/index.html, the URL to the other pages should have worked. However you went via localhost (the right way), instead.

Be sure to start all your URLs with http://localhost/[yoursitefolder]/ (or relatively) to avoid this issue, especially when you finally decide to upload to the web.

Also, what Moses meant was sometimes devs use a lone hash (#) as a placeholder for an actual URL, simply to create an anchor on the page. This wouldn't take you anywhere.

Finally, not part of the question, but don't use capitalised HTML tags, they're ugly and I'm pretty sure not recommended :)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .