• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect and refresh meta-tag

 
Naveen Chandra
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, What is the difference between
Redirecting the website and refresh the page with the website after zero or 1 second ?
How do I issue a header 'Location' ?
Do I need to have some script running to issue this header
to the client like Servlet or CGI ?
Thanks,
Naveen.
 
Danny Mui
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Re-directing via meta-tags isn't very pretty to the user (IMHO).
If you load a page with a redirect, it loads the redirect page and then refreshes to the new page. So if you want to go back (by hitting back) to a previous page, you will get STUCK at the redirect page because it redirects !
Using a servlet redirect(JSP or servlet) statement it uses the HTTP status codes that take care of it and works better than meta-tag refreshes (don't remember the details, it just works!).
I create a redirect.jsp or servlet and pass the new URL as a parameter in the query string to do this.
 
Naveen Chandra
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Danny,
Can I use the HTTP status codes, with out the help of
servlet or JSP or CGI's. I mean I have my web site in geocities
which is free, now I got my own domain. So, I need to redirect
the users from my geocities website url to my own url.
Here the point is geocities website does'nt support any server
site scripts like (Servlets, JSP and CGI), but now my server
which is fully in my control supports all and I can have application server and webserver and so on.
Hope I explained my problem clearly.
Thanks,
Naveen.
 
Danny Mui
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your case, I think you need a temporary redirect page that won't be used (hopefully more than once) correct? Meta tags should be fine in that instance hehe
<meta http-equiv="Refresh" content="0;http://www.mynewsite.com">
 
Danny Mui
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I don't know how to do it via status codes, that's an HTTP protocol thing that I don't think HTML/JavaScript exposes.
 
Naveen Chandra
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then how do I use the redirects ?
I don't want to use meta tag to refresh the page.
And how do I issue the "Location" header to the client ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic