Rob Barton
Rob Barton

Reputation: 81

HTML Links are not working

I am currently creating a website, and for some reason a simple task linking to another web page is not working. When I try and link something I get

This webpage is not found. No webpage was found for the web address: C:\me\me\me etc etc".

All I am trying to do is link a work to another page on my web page. Here is my code:

<a href="C:\\users\rob\website\page.html">page link</a>

I have also just tried linking google and amazon and get the same results.

Upvotes: 4

Views: 80563

Answers (5)

Lihini Nisansala
Lihini Nisansala

Reputation: 46

Try <a href = "../foldername/filename" > </a>

../ Defines the root. when you use this style it searches for the file location from the root.

Upvotes: 0

Daanvn
Daanvn

Reputation: 1266

You forgot the second "

try this:

<a href="C:\users\rob\website\page.html"> page link </a>

Upvotes: 0

Anirudh Ramanathan
Anirudh Ramanathan

Reputation: 46728

<a href="file://C:\users\rob\website\page.html"> page link </a>

Also, You cannot load local resources using file:// if the page is hosted on a webserver. That would be a security issue and is hence, forbidden.

Your script console will, in that case also contain:

Not allowed to load local resource: file:///C:/users/rob/website/page.html 

Upvotes: 4

Guru Prasath
Guru Prasath

Reputation: 44

try this,

 <a href="file:///C|\users\rob\website\page.html" > page link < /a>

Upvotes: 0

fcm
fcm

Reputation: 6453

You're not closing the quote on the link. Try <a href="URL goes here" > page link </a>

For instance, <a href="http://www.google.com/" > Google </a>

Also, remember that "C:..." is not a web address, if you want to test locally, try using the file:// prefix.

For instance, <a href="file://C:\me\me\me\page.html" > My Page</a>

Upvotes: 3

Related Questions