Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Jscript

 
gowtham potter
Greenhorn
Posts: 27
Firefox Browser MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write a javascript that redirects the user from my old-blog to new blog.
i used
<script type="text/javascript">
<!--
window.location = "http://hackershaven.wordpress.com/"
//-->
</script>
but if the user redirects from a specific post then i want it to go to that same post on the new blog
eg:-
if the user goes to http://gowtham1.co.cc/heloo.html then it must go to http://hackershaven.wordpress.com/heloo.html.
What should i do?
 
Christian Johansen
author
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to do redirects is on the server. You should make sure to send a 301 Moved Permanently, so spiders also get updated. With Apache you can do this like so:



You _really_ should do this on the server. To answer your original question, this is one way to do it, but I don't recommend it:

 
gowtham potter
Greenhorn
Posts: 27
Firefox Browser MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You!
Worked like a charm!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic