Using the following Blogger.com template, I have been able to redirect all the traffic hitting my old Blogger.com generated pages to the new pages hosted under DasBlog. If you want to try this, change the dasblog_root variables, paste into your Blogger.com template, and then republish your blog. It’s probably a good idea to backup your old template first. No warranties or guarantees, use at your own risk!
For information on porting your content over, see my previous post.
<html>
<Blogger>
<MainOrArchivePage>
<script language=”javascript”>
var dasblog_root=”http://blobservations.net/dasblog/“;
document.location.href=dasblog_root;
</script>
</MainOrArchivePage>
<ItemPage>
<script language=”javascript”>
var dasblog_root=”http://blobservations.net/dasblog/“;
var newpage=dasblog_root;
var oldstring=”<$BlogItemTitle$>”;
var newstring=””;
var toreplace=[‘-‘,”’,’!’,’ ‘,’:’,’;’,’,’,’.’,’+’,’!’];
for (i=0; i<toreplace.length; ++i) {
oldstring=oldstring.replace(toreplace[i],””);
while(newstring!=oldstring)
{
newstring=oldstring;
oldstring=oldstring.replace(toreplace[i],””);
}
}
newpage+=oldstring+”.aspx”;
newpage=newpage.toLowerCase();
document.location.href=newpage;
</script>
</ItemPage>
</Blogger>
</html>
Some browsers don’t have javascript, or some people turn it off. You could do something simpler like this:
html
body
META HTTP-EQUIV="Refresh"
CONTENT="6; URL=http://your.new_url.com"
/body
/html
ChAnge to "CONTENT="6;
To your desired refresh interval
(I took out all the Opening & Closing <> tags so the comment would post! 🙂
The META redirect doesn’t work for the individual post pages since I am using javascript to direct the user to the new post (based on the title). It probably would be a good idea to throw in the META redirect as a backup though, so that non-javascript users would at least get to the new homepage. Good suggestion, Thanks!