Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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
1  
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
1  
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. –  ekaj Apr 4 '13 at 14:40
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.