This post really has nothing to do with statistical trading, but I'm
including as a record of what I implemented since I could find very little help
with this topic on the internet.
The basic issue is to redirect a blog so that new users, old
users, and, search engines all get redirected to the new site. The official way
is the so called 301 Redirect status returned by a web server.
However, that method requires administrative control of the web server —
not something that most users of free blog services actually have.
Asecond method is the meta refresh method, in which we insert a META
tag, such as the one below, into the HEAD section of the home page.
This is something that can be done with a free web service and will instruct a
browser client to redirect to a new page. The one I used was:
<meta
content="0;url=http://blog.gillerinvestments.com"
http-equiv="refresh"/>.
This method will send browsers to the new site
and also allow search
engines to find the new site, as
Google et al. will read the meta tag
and follow the link to the new site.
However, it has the drawback in that it directs solely to the blog front page.
If a user has followed a search engine's results to a post on the old site,
they will loose their position within the blog, and maybe won't be inclined or
able to search again to locate the document they wanted to read.
I decided to deal with this by adding a JavaScript function to be
loaded by the BODY tag's onload event. This can be used to
implement a redirect because web browsers respond to assignment to the window.location
object's href item by loading the new URL.
<script>
function redirect_it()
{
window.location.href=(document.title=="Statistical Trader"?
"http://blog.gillerinvestments.com":
"http://blog.gillerinvestments.com/search.aspx?q="+
escape(document.title.slice(20)));
}
</script>
This script is triggered by the onload event as follows
<body onload="redirect_it();">
What the function does is a little application specific. In my implementation, it takes the
page's title data and passes it to the search function on my new blog site. As I loaded
all of my previous posts into the new blog, that should find the page that a redirected user was looking
at. It would be better to mangle the permalinks, but my new system (BlogEngine.NET) does not use compatible
slugs. As a final wrinkle, it just goes to the front page if the user was just looking at the front
page.
Hopefully, this will not lose too many readers since all they need to do is make one more click to
get to new location of the page that they had actually wanted to look at.