I basically have a stylesheet for mobile which kicks in once the device width is detected.
<link rel="stylesheet" media="screen and (min-width : 320px) and (max-width: 568px)" href="css/smartphone.css">
Everything seems to work until I noticed that my friendly URLs seem to stop the smartphone.css from loading.
www.example.com/page.php?id=001 (everything works)
www.example.com/page/001 (doesn't work)
I understand this might be a mod_rewrite issue, does anybody now whats causing this?
Is this a known issue?
It's a relative URL issue.
Visiting your second example link would result in the CSS link being www.example.com/page/001/css/smartphone.css
You'll either want to add a slash at the start of the CSS file's link, or specify an absolute path.
/css/smartphone.css or www.example.com/css/smartphone.css
Cheers Force Flow, works a treat.
Option #2 is to use the <base> tag as I list in my signature's tutorial.
This topic is now closed. New replies are no longer allowed.