NYCPHP Meetup

NYPHP.org

[nycphp-talk] One more question about Friendly URLS

Kenneth Downs ken at secdat.com
Thu Mar 8 12:16:29 EST 2007


Last question on friendly URLs.

These are very easy to generate and parse, thanks to the tips I've 
gotten here on NYPHP, but I ran into one very strange detail and I'm 
sure I'm not the first human being to hit this problem.

It seems that relative links to CSS and JS all suddenly break.  So if 
you have:

www.example.com/friendly/varname/varvalue/varname/varvalue

and you have a link to "css/main.css", then it will not be able to find 
the style sheet anymore.

So it seems natural enough to make the link dynamic, but then I stumbled 
over finding the "stem" as it were.  Without friendly URLs I have code 
that does not need to know its own site name, it works from context to 
build links.  But with this stuff going in it got really nasty trying to 
do that.

Has anybody else run into this, or rather, what are the standard solutions?



More information about the talk mailing list