This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirection and 404 Error  RSS feed

 
Moses Babylone
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have 2 problems:
1. I need to do a redirection for my website in the following manner. How should I do it? I am using Tomcat server. Please note that there are urlrewrite.xml and web.xml files present on the server.
Current view: www.mydomain.com/blog/12345678
I want this to appear like: www.mydomain.com/blog/this-is-the-title-of-blog.html


2. I tried entering this code for 404 redirection towards my home page. But it does not work. How should I correct it?
<error-page>
<error-code>404</error-code>
<location>/index.jsp</location>
</error-page>

Thanks for helping me.
 
Devaka Cooray
Marshal
Posts: 5555
707
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch.

Do you run on Spring or that urlrewrite.xml is something your code reads? I am not sure what you are trying to accomplish with a 404 (not found) and a redirect. Are you probably trying to do something like showing a 404 error and then redirecting to the new location?
 
Moses Babylone
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
There are two different things. I do not want to mix them.

In general there is no 404 error page coded for the website. So I want to redirect all users to index page in case 404 error happens.

For redirects it is another issue... not related to 404.
All redirects are mentionned in the urlrewrite.xml file. and I want to create a new redirect as mentioned above.

Thank you!
 
Hariharan Thirumeni
Greenhorn
Posts: 3
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the location of your index.jsp. It should be relative to the web app. In your case it should be inside your home web app folder..

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!