I decided to move the blog from Blogger to a self-hosted WordPress.
There are several reasons for that:
– I’m now paying for a web hosting service for the gimx forum
– Blogger is not as customizable as a self-hosted WordPress
– freedom 🙂
I got some issues to solve to make the existing urls redirect to the new blog. Some of these are:
– not possible to have a clean 301 redirect from Blogger
– not possible to redirect static pages with the ‘Blogger to WordPress Redirection’ plugin
After testing a few tricks I hacked a javascript code to generate custom redirects. It’s based on the meta refresh, I know it’s not very clean, but I can’t (or I don’t know how to) do better. A good point of that method is, I can redirect the tutorial blog urls to the appropriate forum threads.
My custom javascript redirection:
[spoiler]
<script type='text/javascript'>
var new_root_domain = 'https://blog.gimx.fr';
var features = /\/p\/features.html/g;
var tutorials= /\/p\/tutorials-tutoriels.html/g;
var videos= /\/p\/videos.html/g;
var faq= /\/p\/faq.html/g;
var contribute= /\/p\/contribute.html/g;
var todo= /\/p\/todo-list.html/g;
var en= /new-english-tutorial.html/g;
var fr= /nouveau-tutoriel-en-francais.html/g;
var de= /neues-deutsches-tutorial.html/g;
if (features.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=11&t=9";
}
else if (tutorials.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewforum.php?f=4";
}
else if (videos.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewforum.php?f=10";
}
else if (faq.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=5&t=7";
}
else if (contribute.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=11&t=8";
}
else if (todo.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=11&t=14";
}
else if (en.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=4&t=5";
}
else if (fr.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=4&t=10";
}
else if (de.test(location.href))
{
redirect_link = "https://gimx.fr/forum/viewtopic.php?f=4&t=13";
}
else
redirect_link = new_root_domain + "?b2w=" + location.href;
document.write("<meta content='0;URL=" + redirect_link + "' http-equiv='refresh'/>");
</script>
[/spoiler]
And my custom redirect page content:
[spoiler]
<div id='outer-wrapper'></div>
<div>
<p><strong>This content has moved!</strong></p>
<p>You should be automatically redirected. If not, visit<br/>
<a href='https://blog.gimx.fr'>
<strong>https://blog.gimx.fr</strong></a>
<br/> and update your bookmarks.</p>
</div>
<!-- end outer-wrapper -->
[/spoiler]
I know the old “label links” don’t work, I will try to fix that latter. If you see anything else broken, just leave a comment!