Sam Philips
Sam Philips

Reputation: 43

Creation of a html link on localhost

I am very new to html. The following link works on a web hosting I am making:

<a href="mywebsite.com/source/Profile.xls">Profile</a> <br />

If I want to make a link on my local server would it be something link this?

<a href="localhost/source/Profile.xls">Profile</a> <br />

Upvotes: 0

Views: 9580

Answers (1)

ExCluSiv3
ExCluSiv3

Reputation: 184

If you would like to make localhost link you should not use localhost, its enough to use folders & files only.

Here 2 link examples:

Link number 1 - localhost link

this link can be used not only in localhost, also in online server hosting, all you need is the file location you need and his extension (.php, .js, .html and more...)

assuming that file.html is inside folder1 and I would like to add link that will direct me in to it, i will write the next code:

<a href="folder/file.html">File.html</a>

lets assume the file i want to be redirected to is one folder back from my website, so I'll add ../ to return back and go to file.html.

<a href="../file.html">This file is one folder before my website.</a>

Link number 2 - unlocalhost link

A link who's not inside my website folder / hosting server will redirect me to other side, for example, stackoverflow.com website, if i would like to add link into stack overflow I will write the next line:

<a href="http://www.stackoverflow.com">go to stackoverflow.com</a>

Upvotes: 1

Related Questions