Web page error in FF3

Web page error in FF3

Posted by: silkrooster
Posted on: 2008-09-19 16:56:00

Does anybody know why a page won't render correctly when a / character is appended to the end of an URL?

http://www.silkrooster.com/links.php/

http://www.silkrooster.com/links.php

I have a feeling is has to do with directories. I try to use relative directies when I can. I see the Google adsense is working which would be an absolute address.
I probably wouldn't have caught this, but i happened to jump back to my site through Google.
Any thoughts?
Silk

My website

Re: Web page error in FF3

Posted by: Alpicola
Posted on: 2008-09-19 19:09:00

You're absolutely right that it has to do with directories. In particular, it has to do with what the browser considers your "current directory" to be based on the URL, which will naturally have a big influence on how relative links work.

The "current directory" for http://www.silkrooster.com/links.php/ is http://www.silkrooster.com/links.php/
The "current directory" for http://www.silkrooster.com/links.php is http://www.silkrooster.com/

Your images, scripts, etc. are in folders underneath http://www.silkrooster.com/ but not also in folders underneath http://www.silkrooster.com/links.php/ which is why your site breaks with the slash but works just fine without it.

In terms of a solution, two ideas come to mind. First, you could simply not use the slash, and try to eliminate any references that might be out there in AdSense or wherever to the slashed version of your site's address. Second, you could put <base href="http://www.silkrooster.com/"> on every one of your pages; the <base> tag forces the browser to treat whatever it specifies as the "current directory" regardless of what the URL says.

Re: Web page error in FF3

Posted by: silkrooster
Posted on: 2008-09-19 19:19:00

Thanks for replying. I am thinking that Google's program for create a site map generated the url with the slash on the end. I need to go through the xml file and check. Funny I never thought about this issue before. Now I am wondering how many had problems with my site and didn't mention it.
Silk

My website

Tags: google adsensegooglesilk