Trailing Slash In WordPress Permalink Causes 404 Error In IE

Posted: September 21, 2009 in Wordpress

Prettifying a URL is an old technique.  It is generally called URL Rewriting.  Why should you do this?  For one, it’s better to look at it.  A URL that has “?s=1&sid=4752891&gn=0&.rand=99olqituu202iqzx37a6” after the domain name, can be quite confusing and unpleasant to look at for those who don’t understand it.  Secondly, re-written URLs are more SEO-friendly and user-friendly as well.  There are many more advantages to URL rewriting, and I won’t cover that here.

Being a WordPress noob, I knew I would be rewriting my URLs to look pretty. Luckily, WordPress has a built-in tool for this so us noobs won’t have to manually edit the .htaccess file by hand. This feature can be found in Dashboard –> Settings –> Permalinks.

Here are a few exmaples of the options already provided by WordPress.

Default – http://www.domain.com/?p=123

Day and Name – http://http://www.domain.com/2009/09/21/sample-post/

Month and Name – http://www.domain.com/2009/09/sample-post/

Numeric – http://www.domain.com/archives/123

The last one is the custom structure, where you have to put in what you want the URL to look like.  Clicking on those radio buttons, you will see that the custom structure text field is filled out with something like,

/%year%/%monthnum%/%day%/%postname%/

which is the structure for the Day and Name option.  Click on other options to see what comes out.  These are already clues on how to customize your own URL.  I made mine put the post name or page name after the domain.  The structure is easy, it’s just like this,

/%postname%

This results in a URL that looks like these,

http://www.domain.com/how-to-cook-beef-stew

http://www.domain.com/about

Be careful with putting a trailing slash on the URL structure.  The Day and Name example above has a slash at the end.  This could confuse some browsers, such as Internet Explorer, thereby causing the dreaded 404 error.

This error may not be exclusive to WordPress permalink structures alone.  It would seem that if you’re not very careful with the rules in your custom .htaccess file and you happen to have a trailing slash in it, chances are you will be getting 404 errors when browsing with IE.

Advertisements

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