• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redirection and 404 Error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7136
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 3
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic