Trailing slash nightmares

This is one that I’m hoping readers might be able to help with. Because I do not have a clue.

What’s a trailing slash? It’s the / that may or may not appear at the end of the URL in the address bar above this page on your screen.

And I have a real problem with a trailing slash that Google so far hasn’t been able to solve. If you visit the URL http://www.earlymodernweb.org.uk/emn/index.php/, some very, very nasty things happen to the layout of the page. [Not any more, see update below.]

The following URLs, however, are fine:
http://www.earlymodernweb.org.uk/emn/index.php
and http://www.earlymodernweb.org.uk/emn/

So WTFFF is going on? (It’s not a browser or PC v Mac issue.) Now, I can easily set up an autoredirect so anyone trying to go to /emn/index.php/ will just get sent to /emn/ – but I really want to know why this is happening so I can fix it properly.

Please help if you can…

Update: Have done the redirect, so no one can land on index.php/ any more. OK, I don’t know exactly why the layout breaks in the way it does, but I should have learnt long ago that using an address that ends “index.php/” is a kind of category error that’s probably just asking to break things. (And now I’m going to put Moll back up the top of the page because she’s much more interesting than this stuff.)

Advertisements
This entry was posted in SiteNews. Bookmark the permalink.

5 Responses to Trailing slash nightmares

  1. Sharon says:

    Oh god I think it’s something to do with .htaccess and rewrite rules. Aaargh!!! I’ve spent the last 2 years avoiding anything to do with learning about those!!!

  2. Robert says:

    “emn/” indicates that emn is a directory. without the “/” would indicate it is a file. when the “/” is omitted your browser usually supplies it if needed.

    IMHO

  3. Sharon says:

    Ah, that makes sense, thanks. Firefox can certainly deal with adding the slash when (in my usual sloppy fashion) I type /emn.

    Well, it seems that best practice is to redirect both the addresses emn/index.php and emn/index.php/ to the directory emn/. (And to be more careful how I type them in future…) So I’ll fix that now.

  4. Jeremy says:

    Know what I like about .htaccess?

    Absolutely. Nothing.

    At least not yet. That’s one of about a dozen things I have on my list to learn. I’d love to change my permalink structure, but if I do that anyone who has linked to a post using my old permalink structure won’t get redirected to the new URL. And I’ve yet to figure out how to deal with that.

  5. Sharon says:

    If you find out, let me know…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s