Forum Moderators: phranque
http://www.example.com/Albany+New_York/ actually calls
http://www.example.com/sitepage.php?urldata=Albany+New_York
I have all the DB lookups working and pulling data into the page and now it has finally come time to design the site!
Here is the problem...I am using CSS to break my page into grids for ease of design.
I have verified that the following two URL's produce the exact same page source:
http://www.example.com/sitepage.php?urldata=Albany+New_York
http://www.example.com/Albany+New_York/
However, the first (sitepage.php in address bar) interprets the css correctly and the second (no explicit document type in the address bar) does not interpret the CSS correctly and the formatting doesn't work.
I am an Apache newbie but theorize that it isn't interpreting the page type correctly as html?
Any help is GREATLY appreciated.
[edited by: jdMorgan at 1:02 pm (utc) on May 25, 2006]
[edit reason] Example.com [/edit]
<style type="text/css">@import url(/iestyle.css);</style>
-or-
<style type="text/css">@import url(http://www.example.com/iestyle.css);</style>
instead of
<style type="text/css">@import url(iestyle.css);</style>
It is the client (browser) that resolves relative URLs; If you've fooled it by using mod_rewrite or content negotiation to change the actual URL-to-filename mapping, it will generate incorrect URL requests (these should be visible in your server access logs).
If the links are relative, as in the third line above, then the CSS file would be called at
http://www.example.com/iestyle.css
http://www.example.com/Albany+New_York/iestyle.css
respectively for the two URL examples you posted, because the browser doesn't know that /Albany+New_York is a 'virtual' and non-existent directory; It just uses conventional URL-manipulation rules to remove the current "filename" and add the given relative path in every case for relative URL resolution.
Jim