Having nice clean permalinks
If you want nice search friendly permalinks that don’t involve numbers and question marks you can tweak this in your WordPress dashboard.
Click on Options/Permalinks, choose your favoured style. I’m going to go with a custom style that’s numeric and name based: ie http://blogmaking.net/blog/123/sample-post/ so I click on the custom option and paste:
/%post_id%/%postname%/
but feel free to choose what you like best. Then click save. Depending on the permissions on your directories, it may let you do it (it let me do it on my manual DreamHost install) and then you don’t have to do anything more.
Or else it will tell you to update your .htaccess file with some code. COPY THIS CODE.
Check to see if there is a .htaccess file in your blog’s main folder (so if your blog is domain.com/blog/ then it would be in “blog”; if you set it up in the root folder, then it would be in the root folder). If there is a .htaccess file, add the code you copied earlier to the end of it. More often than not there won’t be a file so you’ll have to make it yourself. It is pretty simple.
Create a text file in your main blog folder and call it “.htaccess” (there’s no .txt extension!) and paste the code into it.
Test it works by clicking on any of your posts, it should now be the structure you asked for earlier and it should go to the page desired. Sometimes Wordpress is funny and doesn’t let you do this, in which case it could possibly be a server problem and the way it handles rewrites. You’d have to follow this up with your host.
Post a Comment