English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi,
I just started uploading this website and started linking the pages but after I linked them there was something weird. The links on the index page work fine but when I go to another page from there the URL of the page I just clicked on will be added after the URL thats alwready there. For exampleif I'm on www.yahoo.com and click on mail the URL becomes www.yahoo.com/mail (thats fine), But if from there I click on another page lets say NEWS (just as n example), The URL in my site would become www.yahoo.com/mail/news and it should be www.yahoo.com/news

Please if anyone knows a solution I'll appreciate it very much.
Thank you in advance.

2006-07-17 20:02:17 · 3 answers · asked by ermalak 1 in Computers & Internet Programming & Design

Thanks a lot to everyone the ../ fixed everything.

2006-07-18 04:10:14 · update #1

3 answers

It sounds like you're using relative links in the wrong places. Like, you'd have a link that's supposed to go to /news/index.html (or simply /news, but it doesn't really matter for the sake of discussion) that looks like this:
News
but it because it appears on the mail page it must read like this in relative form:
News
or this in absolute form:
News
Try to keep your links relative as in the first solution, if possible, because you won't have as many links to change if you move things around.
To make this clearer, I should mention that the two dots (..) in the relative URLs mean "parent directory." If you omit them, browsers will follow the links relative to the current directory, and not the parent of the current directory. The .. may be substituted anywhere in the URL that it makes sense. For example, you could probably get away with a link to news/../news/../news/../mail/index.html
Again, unless you're linking to another site, you should try to use relative URLs because it will save you work in the long run.

2006-07-17 20:10:47 · answer #1 · answered by anonymous 7 · 13 3

fedest.com, questions and answers