Jump to content
xisto Community
Sign in to follow this  
itssami

How To Give Hyperlinks To Site Before Upload?

Recommended Posts

Hello..
I have made a website,suppose it has 20 pages and it is linked to pages.It is saved on my computer.Im confused about hyperlinks.I mean how i should create them , when i will upload that site.
For example. n index page I have 2 pages links, page 1 and page 2....On computer , they will be linked like C:\page1.htm and C:\page2.htm , but when i will upload them their links will be something like http://forums.xisto.com/no_longer_exists/ and http://forums.xisto.com/no_longer_exists/ ,
okay , if the pages are very few then i can give think that its http adress will be like that and can give it already to the index file on my computer but if i have many pages then it will be hard for me to think which are the http adress of them when i will upload them , so how i can manage this and how i should give hyperlinks to pages .Please let me know about this problem.Thanks.

Share this post


Link to post
Share on other sites

Ok for this I'll suggest you to use the hyperlinks like this :Lets say you've made a folder in c: drive as website.Now, if you are storing your index.htm in that (c:\website\index.htm) and you've another page "page1.htm" which is stored in another child folder "pages" of "website" folder (c:\website\pages\page1.htm)And now you want to link page1 to index then in the html file use the link as

<a href="pages/page1.htm">click here to go to page 1.</a>

I hope this clears up things!

Share this post


Link to post
Share on other sites

This is something that seems to confuse a lot of people new to web design. The easiest way to sort out your linked pages is to use 'relative' links. A 'relative' means the link assumes the page being linked to is in the same folder as the page with the link. To do his keep all your pages in one folder, usually your 'root' folder often called 'public_html' on the web server. It also good practice to keep all your images for your pages in a separate folder called 'images' which is inside your 'public_html' folder. To link to a page in the same folder as the one with the link, you do not need to prefix the page name with 'yoursite.com/', all you need is the page name like this...

<a href="page2.htm">Page 2</a>
To use relative links for images you can do it in a similar manner, just prefix the image name with the folder name like this...

<img src="images/image1.gif">
If you make the same folder structure on your hard drive as on the web server, the site will work exactly the same on your hard drive and the web server. Relative links will work for pages in all folders provided you prefix the image or page name with the relevant folder name where necessary. [edit] mayank posted his message as I was writing this one, we are both saying the same thing, I have just given more explanation.

Share this post


Link to post
Share on other sites

Itsammi, Avalon, and Mayank:

Here is a fairly complete guide to Linking on your website. It is nicely written and easily understood.

linking html

The only thing it doesn't explain are 'server absolute links' which is a whole other topic for discussion. Since they are available only on the Apache servers like the one here at the Trap, I don't suggest using server absolute links since your site may someday be on another server.

http://archive.ncsa.uiuc.edu/General/Internet/WWW/HTMLPrimerP2.html#LI2

This is the link that I have placed above. It is called an 'absolute' link because it references an html document directly (absolutely) by indicating the server address (http://archive.ncsa.illinois.edu/), the specific folder and the chain of folders (/General/Internet/WWW/), a particular file (HTMLPrimerP2.html), and a 'named anchor' within that file (#LI2). I only use absolute links to pages outside of the web site that I am working on. Inside the web site, relative links are recommended. That way, the file structure stays constant whether it is on the server or on the 'local host'.

Relative links are also described in the document. They are indicated without the 'http' part and are 'relative' to the calling file's address. As Avalon pointed out above, it is typical to have the Images in their own folder at the root level and his info is perfectly fine. I just wanted to add that in a more complex file/folder structure, there is way to navigate the structure using 'parent folder' notation by including "../" or "./"'s in front of the file names to navigate around the site, but that might be a bit much for now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.