Things You'll Need:
- notepad
- access to the root of your site
- your Wordpress site MUST be hosted on an Apache server to follow this guide
-
Step 1
Wordpress Control PanelFirst, log in to your WP control panel and select “permalinks” under the settings menu.
-
Step 2
permalink settings pageCheck the "Custom Structure" radio button and choose a new structure that you want to use for your URL's to make them pretty.
Personally, I just use the name of the post in the url, but for maximum SEO benefit, you might want to use "category/post" structure. I.E. http://www.example.com/your-category/your-post/. However, to forward links to links with "cat/post" structure will take 1 line for each link you want to forward and is beyond the scope of this article.
To use just the post name as your structure, put /%postname%/ in the "custom Structure" text box. -
Step 3
This step is necessary to keep your visitors and the search engines from seeing broken pages.
Download your current .htaccess file from your websites root folder. We will add 2 lines to this file to keep your links from breaking. This file opens with notepad and must be saved in its current form when done.
If you were using the default links - http://example.com/?p=N - then this won't work for you. You must be using - http://example.com/year/month/day/post-name or http://example.com/year/month/post-name.
If you are using http://example.com/year/month/day/post-name, then you want to add this to your .htaccess file:
Redirectmatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$
http://example.com/$4
If you are using http://example.com/year/month/post-name, then you want to add this to your .htaccess file:
Redirectmatch 301 /([0-9]+)/([0-9]+)/((.*)$
http://example.com/$3















Comments
xopinkdiamondz said
on 4/14/2009 Good article. 5* AND A RECOMMENDATION!
Upon-Request said
on 4/14/2009 Good article on fixing ugly permalinks in Wordpress. 5*