
As I mentioned yesterday I switched this blog over from michele.me to michele.blog. And a BIG thanks is owed to Don and Paolo from the .blog team for helping me get that domain in the first place!
The michele.me domain will be used for “other things” in the future, so I am splitting the blog away from the rest of the site.
As part of the switch I’ve also changed the WordPress permalink structure over to the shorter or more direct /%postname%/ using Yoast’s handy little tool to generate the necessary rule.
In order to do that “sanely”, while also trying not to lose any web traffic I’ve got two sets of redirects setup:
- Over on the michele.me server there’s a mod_rewrite rule in Apache that is meant to catch any traffic destined for michele.me/blog and send it to michele.blog, while preserving the requested URL. eg. if the requested URL was http://www.michele.me/blog/archives/2016/12/working-preparing-new-house/ then it should pick up on the bit after /blog/ and send it over to the other server so that you land on https://michele.blog/working-preparing-new-house/
- On the michele.blog server there’s a mod_rewrite rule in the .htaccess that will map the old permalinks to the new and shorter one (the example above shows how stupidly long the paths were previously). It’ll transform the old (and super long) URL to the shorter permalink structure.
Everything is *almost* working, but there are a few stupid problems that I can’t seem to fix, though I know they should be fixable via mod_rewrite.
At the moment *any* traffic hitting http://www.michele.me/blog ie. the former “root” or “home” of this blog is being sent to the wrong place. Instead of it going to https://michele.blog it’s ending up at https://michele.blog/blog-award-time/
The mod_rewrite rule in Apache is:
RewriteRule ^/blog/ https://michele.blog%{REQUEST_URI}
So while it’ll pick up every other URL that was under michele.me/blog it’s not handling the “root” link properly at all.
On this server there’s a mod_rewrite rule that is handling the mapping to specific posts, pages etc.,:
RedirectMatch 301 ^/blog/archives/([0-9]{4})/([0-9]{2})/([^/]+)/$ https://michele.blog/$3
I’m not sure which of the two rewrite rules is missing something, but I suspect it’s the first one.
So if there are any Apache mod_rewrite gurus out there who have any idea on how to fix this before I lose my mind I’d love to hear from you!







Leave a Reply