View Full Version : links


george123
01-20-2006, 02:55 PM
Greetings,

If a new folder is created within the domain, and in a file within the new folder I want to create a link back to the home page, what is the href command.

Example:

Main site: mydomain.com
Folder: mydomain.com/tour
Sub folder: mydomain.com/tour/tour5.html

I want to link a worrd within the tour5.html back to mydomain.com.

When I link to index.php it is lookng for the page within the folder tour???

Help

djou
01-20-2006, 05:00 PM
Greetings,
Main site: mydomain.com
Folder: mydomain.com/tour
Sub folder: mydomain.com/tour/tour5.html


Let's say you put <a href="index.php">link</a>, it will search for index.php in the current folder.

If you put <a href="../index.php">link</a>, it will search for index.php in the "previous" (or containing) folder, in this case mydomain.com

You can also use <a href="/index.php">link</a>, which will search for index.php in the root directory. This link, place on mydomain.com/file.html, mydomain.com/tour/tour5.html or mydomain.com/stuff/folder/page.html would always link to mydomain.com/index.php

~Shinta
01-20-2006, 07:44 PM
I suggest you just use full paths. It won't hurt you to type it all out...

djou
01-20-2006, 08:00 PM
I suggest you just use full paths. It won't hurt you to type it all out...

Why?

~Shinta
01-20-2006, 08:23 PM
For me... No just kidding... Full paths work well because you might want to move a file to a new folder, so if the path is relative it would not break.

george123
01-21-2006, 03:55 PM
Thank you all for the replies. i fixed the problem with the "/" first hence allowing me to revert to the root directory.

Thanks again,

GT