Query Strings Not Returning What Was Expected
Tuesday
Sep 01, 2009
5:00 am
Outdated URLs from the days of WordPress are still floating around in in collective memory of the web. The way I had WordPress configured everything was accessed through a query string to the root document. (I think this may be true of any WordPress configuration but I'm not sure)
The point is that hitting the root of this blog with almost any query string now just renders the home page. The query string is ignored. I was careful tp preserve links to posts (/?p=123) and the rss feed (/?feed=rss2) but other things like tags and categories were simply not handled, and will not be any time it the future.
Instead of rendering the main index page these query strings should return a 406 error. doing so would clue in the search engine spiders that what they were looking up no longer existed. I have plans to change the router to make this happen, and if I everything goes right urls like /?tag=ruby will return 406 by the time this post goes live.
On the other hand, this is just one of many good reasons why using the query string for routing is just a bad idea in the long run. It also made it very difficult to write a robots.txt that would keep the bots out of things like tags or categories. These are just different groupings of the same content, but they often ranked higher then an individual post on a subject. In my opinion landing on such pages from a search presents the user with too much irrelevant information.
When subjects (was tags) and Categories make their reappearance they will have pretty URLs and not show up on anyones search results.