This post is not really about cloud computing, but someone might find the information useful, I believe.
Being a newbie with blogging and WP, I made an annoying mistake when I initially created my blog. I set the permalinks to be the default (it’s usually the best, right?) which means the link to a post would be something like http://www.example.com/blog/?=p123 while a nicer link would be something like http://www.example.com/blog/cloud-computing-is-great which clearly gives a reader some indication of what is the post name and what it is about. Search engines are really not too interested with those “?” etc. weird characters either. I realized this when I had subscribed to a few RSS feeds which clearly did not have any posts without a pretty link and my blog would not show up in Google Blog search as I had the original feed in a form http://www.dkaiser.com/?=feed2 or roughly similar.
Ok, onwards with the project! I had about eight posts and not really too much visitors either, so I could easily change the permalink structure, right? There is an option in the WP admin panel to do this. I wasn’t too worried about possible broken external links to my blog, since I bet there is no fan club for this site… I changed the permalink structure from default to custom with /%postname% as the new permalink. There was a notification to modify the .htaccess file since WP could not write the file itself. So I started looking into that, actually there wasn’t any .htaccess file in place, probably because of the default installation. I really did not bother to start searching on how to write it myself, so I decided to change the folder permissions in the /blog folder instead. Eventually, the .htaccess file was created.
Hitting refresh in the browser for the blog now gave all new links to every tag, page, post, you name it. A few of them actually worked, like the pages and categories, but the most important – the posts – were stuck in a redirect loop. Apache was trying to redirect all posts to the root of the blog. Which was weird, but probably easily understood by a person who knows about mod_rewrite and regular expressions. My knowledge of theoretical computer science with regards to regexps is a bit rusty to say the least. Luckily, there are a few nice people who know about it (I presume), since there are a few WP plugins which you can use to redirect the pages. I went ahead with Dean Lee’s Permalinks Migration Plugin. There are instructions on how to use the tool, but sadly, the first few tries did not really work. I was messing up the old and new structure and I also found one issue from my httpd.conf as it did have “allowoverwrite none” defined. I proceeded as follows:
- Set “allowoverwrite all”
- Restart Apache
- Setting / to be the old structure in Permalinks migration tool, clicking update
- Going in Permalinks and setting /%postname% to be the new structure, clicking update
- Going back to Permalinks migration tool and clicking update
This is how I fixed my problem, but I really recommend all to create a pretty link structure before you start blogging. I am not guaranteeing the information here will fix your problem, but test your settings before going live. That’s what I did and of course in Amazon EC2!
Pauli Haikonen

