View Single Post
Old 06-14-2005, 03:04 AM   #5
Vertikal
Former Member
 
Join Date: Jun 2005
Posts: 6
Relative links

Charter,

All my sites use relative links and rarely absolute ones relative to the root (like '/directory/directory/file.htm' rather than '../directory/file.htm') and never links with http:// when links point to pages within the same domain.

The reason is transportability. Sometimes a whole subdir moves location before going online. The sites also need to be able to run in different environments - Windows for development and Linux when running live - and need to be able to move between hosts with different names, be it local or online.

In PHP you can always get the fully qualified URL from a relative one using some of the path-functions in combination with the $_SERVER globals.
The browsers don't care the least. They can follow all links as long as the end-result is valid. I would recommend that a crawler did the same thing - if that is the problem.

Again: thanks for the effort you put in this.

Martin
Vertikal is offline   Reply With Quote