posted
Somebody told me once that it was better to use relative links in your web pages than absolute links. I'm having this annoying problem with my relative links such that sometimes it will strip off the www. from the beginning of the URL. I think it sometimes also adds it back in, but I don't remember. Does anyone know of any way I can get it to quit doing that?
Posts: 4534 | Registered: Jan 2003
| IP: Logged |
posted
Actually, what its better to do is use absolute links . . . which are generated programmatically by detecting context.
But that's complicated sometimes, so its usually better to just use relative links.
Why are you saying its stripping or adding the www? Its definitely not doing either just by clicking on links unless something wrong is happening elsewhere . . . However, if one were to be on the site accessed via www.example.com, then click on an absolute link that used example.com, any further relative links would be for example.com because they're, well, relative.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |
posted
Well, all of the intrasite links at sakeriver at relative links, and sometimes when I click on one of them, the page that pops up doesn't have the www. That is, sometimes I click on a link on the www.sakeriver.com/index.php page and get send to sakeriver.com/[whatever].php. It's not only annoying for aesthetic reasons, but it also screws up my cookies.
Posts: 4534 | Registered: Jan 2003
| IP: Logged |
posted
Not all of them are relative. Check out the email link in your nav, for instance.
I suspect the issue has to do with your DNS. If for some reason your DNS server doesn't respond quickly enough with an IP for www.sakeriver.com, your browser may have it try sakeriver.com . This would be a rather esoteric occurence in everyday use, though.
Relative links cannot cause this, though.
Posts: 15770 | Registered: Dec 2001
| IP: Logged |