Trying to change the world, one thought at a time

Blogger to dasBlog Redirect Hack

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>

» Similar Posts

  1. New Blog Engine!
  2. How I Ported My Content from Blogger to DasBlog
  3. Jason Kolb is trying to reinvent the Internet.

» Trackbacks & Pingbacks

    No trackbacks yet.
Trackback link for this post:
http://blobservations.net/trackback.ashx?id=137

» Comments

  1. 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! :)

    Matt — June 11, 2005 6:37 PM
  2. 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!

    Rick H. — June 12, 2005 1:56 AM

» Leave a Comment

ipad apps free porn videos sex chat ipad case baby toyssex chatsex cams, live sex show, sex webcams http://www.7yil.com