we are building a website is there truth that it slows the process down if you use http://websitename.com/pages/link.php rather than pages/link.php . I am not sure what is best. Could someone help me with this one and let me know why? Thanks.
Mark
using full links or relative links
Moderator: General Moderators
-
mccommunity
- Forum Commoner
- Posts: 62
- Joined: Mon Oct 07, 2002 8:55 am
Well, by using
Would make the HTML file larger in size which could slow down the page load time.
Code: Select all
<a href="http://websitename.com/pages/test.html">-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
not sure how browsers work, but im assuming after it connects to the main server, loading directorys under it would take less time.
I've always used relative, cept for things, like includes, that go on every page (in different directorys), because you'd need absolute for them. and of course, other people's sites.
I've always used relative, cept for things, like includes, that go on every page (in different directorys), because you'd need absolute for them. and of course, other people's sites.
If you ever need to change URLs (http://www.xxx.com becomes http://www.yyy.com), your static links will all break. Personally, I use dynamic linking (./page.html or ../mydir/mypage.php). This way, I can just move my directory tree around and there are no problems if I change the URL name. The only time I use static links are when I have subdomains and I need to get to a different part of a site (admin.site.com to site.com).
Hope that helps.
Hope that helps.
The main reason for using relative links (as I've learned anyways) is to hide the document root. Depending on how your webserver is setup this is important. Because in many cases the relative link dir/link.php points to a different place compared to http://somesite.com/dir/link.php...