aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Help with Jscript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help with Jscript" Watch "Help with Jscript" New topic
Author

Help with Jscript

gowtham potter
Greenhorn

Joined: Nov 02, 2010
Posts: 27

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?


hai visit my website http://hacktohell.blogspot.com
for tech tips & tricks
Christian Johansen
author
Ranch Hand

Joined: Oct 03, 2010
Posts: 46
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

Joined: Nov 02, 2010
Posts: 27

Thank You!
Worked like a charm!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help with Jscript
 
Similar Threads
Blog advice
Windows XP Popup blocking
cannot redirect to secure page
forms authentication (j_security_check) with JSF
passing javascript variable in java method