I have a qimple question :
Does it matters to put absolute links inside you website ?
exemple : instead of ../test.php -> http://host.com/test.php
Will it change something, like speed would be the most obvious or not ?
Have a nice day ! Thanks for your help !
Either way is fine, but if you ever change domain names, then you'll have to change all of those links. Relative links are better, especially relative to the document root (links starting with /). Speed wouldn't be a noticeable factor.
It doesn't really matter, when you think of the way your browser works.
When your browser follows a relative link, it works out the absolute link based on the directory the current page is in.
So the request to the server is the same either way.
However, make sure you are consistent with your links. If you have a page called http://www.myhost.com/thispage/ , then don't refer to it later as "thispage" (without the trailing slash) or "thispage/index.htm". Even though they may find the same page, the request to the server is different and thus caching is not working.
You could, however, refer to it just as "/thispage/" or "../../../thispage/" etc, as the browser will translate that to "http://www.myhost.com/thispage/"
If you see what I mean.
Thanks for your posts !
I asked because I work with "php-includes" so relative links would have been more difficult to manage.
C ya and thanks again ! :)
I made my links always relative, because it will make your life easy if you like to move folders around later on. This is a rule we always trust!