A simple way to redirect link when change blogger name (URL)

It's always a hard work changing web site or blogger name (URL)

When change URL of your blogger, you may want to redirect the connection to new site, usually we put a resirect link in the meta tag on old site, but this will redirect all connection to home page of new site, if people link to one of your article directly, he will still be redirected to home page and can't find the original article, then you lose readers.

So the better way is to redirect each article to new site, here is a very simple way to do this.



Chagne your blogger site name to new one, then open another blogger site, name it with you old name.

Then just copy and paste the following content to replace the theme content,of courese you need to change URL to your new site ❤️

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html>
  <head>
    <b:skin></b:skin>
  </head>
<body>
  <b:section id='temp'></b:section>

<script type="text/javascript">  
  location.href = "https://angeloeyez.blogspot.com"+location.pathname;
</script>

</body>
</html>



Reference data (get connection data using javascript)
<script type="text/javascript">
    //http://www.w3schools.com/htmldom/dom_obj_location.asp  
    document.write("location.href : "+location.href+"<br/>");
    document.write("location.protocol : "+location.protocol+"<br/>");
    document.write("location.hostname : "+location.hostname+"<br/>");
    document.write("location.host : "+location.host+"<br/>");
    document.write("location.port : "+location.port+"<br/>");
    document.write("location.pathname : "+location.pathname+"<br/>");
    document.write("location.search : "+location.search+"<br/>");
    document.write("location.hash : "+location.hash+"<br/>");
</script>

留言

這個網誌中的熱門文章

[TCL] 基本語法與指令 - 2. TCL 語法

[TCL] 基本語法與指令 - 1. TCL 簡介

[TCL] 基本語法與指令 - 3. 資料型態