Help - Search - Members - Calendar
Full Version: Trailing Slash Weirdness
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
BillB
I've just had a reader write to tell me that when he clicks on the "main" navigational link on my individual entry pages...

QUOTE
« Just Came In to Dust and Pick Up My Mail | Main | Bits in Search of a Premise »


... he gets a 404 error. the problem, it looks like, is that the URL underlying the "main" link contains an unneccessary (and unwanted, and bad and evil and wrong) trailing slash, i.e.:

CODE
http://www.billbarol.com/blather/


when it should be:

CODE
http://www.billbarol.com/blather


so I guess this slightly but significantly erroneous URL is being generated somewhere in my MT code. can anybody point me toward where it lives so I can correct it? many thanks in advance.
nammer
This is the Site URL you specify in Weblog Config; you're looking at the $MTBlogURL$ tag described here; the docs indicate a trailing slash is okay - what do you have entered there?

Donna
BillB
site URL specified in weblog config is URL without trailing slash:

QUOTE


I've also looked at the individual entry archive template to see if the $MTBlogURL$ tag contains an extra slash, but it doesn't.
imabug
It looks like blather is a file (sans extension). Correct?

If so, then it looks like MT is interpreting your site URL as a directory (and quite rightly so... blather has no extension, so it gets treated as a directory) and adds the trailing slash. But since there is no blather directory, the web server returns a 404 Page Not Found error.

To fix, what you should really do is publish your Blather index page to blather.html and put it into the blog directory (along with your archives), or create a directory called blather, and publish the index page there. And change your Site URL accordingly.

Or, just create an .htaccess file and set up a redirect for http://www.billbarol.com/blather/ -> http://www.billbarol.com/blather

Personally, I think the first method would be preferable and will break things less. The .htaccess method just hides the badness.
BillB
hmmmm. this shows signs of turning into one of those things that nobody's really complained about before, and might be easier and simpler to leave alone. but thanks.
imabug
by fixing it, you will probably repair several other broken things that nobody has noticed yet. If I'm not mistaken, $MTBlogURL$ comes from the Site URL specified in Weblog Config and is/can be used to construct other URLs. If this isn't correct, then any other URLS built with $MTBlogURL will be broken also.

The fix is simple.

[*]Create a directory called blather

[*]Change Site URL to http://www.billbarol.com/blather/

[*]Change Site Path to /path/to/blog/blather

[*]You might have to change the Output File on your Main Index template. Change it back to index.html

[*]Rebuild

[*]When everything looks as it should, get rid of http://www.billbarol.com/blather
LisaJill
You might look at cruft free url's as well, as they purposely aim for file names with no extension, and there might be something there you can use to fix this.
girlie
QUOTE (BillB @ Jan 26 2004, 02:11 PM)
the URL underlying the "main" link contains an unneccessary (and unwanted, and bad and evil and wrong) trailing slash, i.e.:

A trailing slash after an actual directory name is not evil at all - it decreases page load time for the server by letting it know to look for a directory rather than a file.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.