Archive for the ‘Wordpress’ Category

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.

For new WordPress users trying to set up a website and using the former as a CMS, this is usually among the first questions asked.  This is really easy.  In fact the WordPress Codex has it all written down step by step here.

Then usually, the next question after having done the steps is, “I have 2 Home pages now.  How do I fix this to show just one?

Under “Troubleshooting Themes” of the tutorial explains a bit on why this happens.  If you’re not patient enough to learn the internals of WordPress or manually edit a template file, the quick solution to this problem is a plugin.

Search for WordPress plugins that deal with Page Management.  I use pageMash to do this.  It’s not very updated but it still works up to 2.8.4 quite well.  If there are more updated (compatible and tested with 2.8.4 version) plugins that deal with page management I would suggest you install that instead.