NYCPHP Meetup

NYPHP.org

[nycphp-talk] One more question about Friendly URLS

Allen Shaw ashaw at polymerdb.org
Thu Mar 8 13:51:44 EST 2007


Kenneth Downs wrote:
> Chris Shiflett wrote:
>>You can still use relative URLs. Just use an absolute path:
>>/css/main.css
> 
> So both are actually relative, it is more a matter of relative from 
> where?  A "relative" path is relative from the complete path of the HTTP 
> request, while an "absolute" path is relative only from the domain of 
> the HTTP request?
> 

The difference is in the terms "relative/absolute URL" and 
"relative/absolute path".  An absolute URL starts with 
"(ftp|http|etc.)://" and generally works against you when it comes to 
caching, etc.  An absolute path starts with "/" and indicates that the 
given resource can be found by appending given path to the site's domain.

Using an absolute path gets you none of the troubles you mentioned with 
relative path, and none of the caching problems you'd get with an 
absolute URL.

- A.

-- 
Allen Shaw
Polymer (http://polymerdb.org)
slidePresenter (http://slides.sourceforge.net)



More information about the talk mailing list