• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to redirect users to another address

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
I have a problem that i do not know how to resolve.
we had an application in an address like :
http://www.myweb.com/web2/ it is a dynamic application written in java .
now we move it to another server like : http://10.10.a.b/web2/
we need all people that come to the first address to be redirected to new address with the complete url for example if some one come to http://www.myweb.com/web2/register.jsp
we should be able to redirect him/her to http://10.10.a.b:8888/web2/register.jsp

what should i do now ? is there any way that i can do this ?
i am allowed to deploy a java web application to first address to do this , i mean i can deploy some java web application to http://www.myweb.com/web2/ to make this redirection possible.
does any one hav an idea ?

thanks
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a servlet that is called when http://www.myweb.com/web2/ is requested, and in the doGet and doPost methods:

request.redirect("http://10.10.a.b/web2/");
 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or if you don't want to use java,
you just can use javascript:

In the <body> tag of the old page (http://www.myweb.com/web2/register.jsp) do this:
<script type="text/javascript">
window.location='http://10.10.a.b:8888/web2/register.jsp'
</script>

It will bring the user to the desired page.
Hope this helps.

- Rudy -
 
Rudy Rusli
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or if you don't want to use java,
you just can use javascript:

In the <body> tag of the old page (http://www.myweb.com/web2/register.jsp) do this:


It will bring the user to the desired page.
Hope this helps.

- Rudy -
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic