Sunday, April 18, 2010

Redirect page to page on blogger use css or javascript

To Blogger Users, Want to redirect a page to another page or URL to URL..?

Look at the example script below, on red color is source of URL/page that would be to redirect , and blue color is destination url of direction where it will be addressed

Place the code after <head> tag, before <b:skin><![CDATA[/* tag

EXAMPLE 1

<b:if cond='data:blog.url == &quot;http://free-7.blogspot.com/2010/04/SOURCE.html&quot;'>
<meta http-equiv="refresh" content="0; url=http://free-7.blogspot.com/2010/04/DESTINATION.html" />
</b:if>

EXAMPLE 2

<b:if cond='data:blog.url == &quot;http://free-7.blogspot.com/2010/04/SOURCE.html&quot;'>
<meta http-equiv="refresh" content="0; url=http://WWW.GOOGLE.COM" />
</b:if>

I think the best way is to add NOINDEX meta tag , to avoid considered as SPAM by search engine spiders

EXAMPLE 3 :

<b:if cond='data:blog.url == &quot;http://free-7.blogspot.com/2010/04/SOURCE.html&quot;'>
<meta http-equiv="refresh" content="0; url=http://www.seokick7.com/" />
<meta content='NoIndex' name='Robots'/>
</b:if>

Here, you can also change the value of content="0 , for example : content="12 (12 seconds), and make an alert message on your page/blog post :

Example text on your post/page : "You will be redirected to www.themes7.net in about 12 seconds, Okay.."

Another way, use JavaScript,
Place the code after <head> tag, before <b:skin><![CDATA[/* tag , on the source blog (a blog url where use the code below will be redirect to "YOUR-DESTINATION-LINK.com" )

Example-1:

<script language='javascript' type='text/javascript'>
window.location=&quot;http://YOUR-DESTINATION-LINK.com/&quot;;
</script>

Example-2

<b:if cond='data:blog.url == &quot;http://YOUR-SOURCE-LINK.HTML&quot;'>
<meta content='NoIndex' name='Robots'/>
<script language='javascript' type='text/javascript'>
window.location=&quot;http://YOUR-DESTINATION-LINK.com/&quot;;
</script>
</b:if>

Use the redirect methods according to your purpose.

2 comments:

  1. How to use multi redirect? Example: 10 post url to a specific domain.

    ReplyDelete

Please leave your comments or your promotion links, but don't add HTML links into the comment body, because I consider it as a spam, and will be delete..

Thank you for your visit..