If I change my permalink structure or category base it breaks almost all my links. I'd like to see a feature added that would record the old URL and the new URL, and whenever someone visits the old URL redirect it with a HTTP code 301 "Moved Permanently" to the new URL. For example, assume I went from:
/%postname%/
to
/%year%/%postname%/
And to illustrate assume I had only one post with a slug of "foo-bar" published in 2007. The redirect table would contact two fields:
old_url_path -> new_url_path
/foo-bar/ -> /2007/foo-bar/
If for some reason the old URL had been replaced by a new URL, i.e. we went from this:
Old Post URLs: /%postname%/
Old Archive URLs: /archives/
to this:
New Post URLs: /%year%/%postname%/
New Archive URLs: /categories/
Now let's assume we had previously written a post with the slug "categories" in 2006, admittedly a contrived example. We'd record the following in the redirect table:
old_url_path -> new_url_path
/categories/ -> /2006/categories/
However, because the URL path /categories/ now is mapped to the archives it will takes priority on any request. So for those wanting the post previously referenced by old resource on the page returned by the URL path /categories/, it could include a link at that top that says:
"There was previously a post with this same
URL with the title "Categories" which is now
located at /2006/categories/. Were you
looking for that instead?"
If the user answered YES it could also record the referer and then notify the admin to configure to automatically redirect whenever that referer was found in the HTTP headers.
An admin could optionally turn this off the notice at the top of the page, if desired, and also it should optionally not appear if redirected from an existing page on the site were an index would exist.
Lastly, there should be an interface that would allow the admin to delete any redirects, add any of their own, and also tag any to not show up with a message at the top of a page when the URL was superceded.
BTW, I'd LOVE to write a plug-in for this if someone could direct me. I consider myself an advanced Windows+IIS+SQL Server+ASP developer but am just starting to learn Linux+Apache+MySQL+PHP (though I'm reading numerous books on the combined subjects of LAMP and have Ubunut installed on VMware, I've just found no books on writing WordPress plugs-ins.)