In the spirit of answering my own question:
 
To make things pretty for search engines I want my new URLs to look like:
 
 
where id-12345 indicates the product id the requestor wishes to see.  I am using a command pattern so prior to my rewrite efforts all my product detail URLs looked like:
 
 
jBoss hosts the database driven part of the website and I don't want to rearchitect so I have my rewrite rule change the pretty inbound URL to the process_command form. 
 
The problem is I need to send permanent 301 redirects for all inbound requests of the old form so that the outside world will be permanently redirected to the pretty URL.  If Apache does the url rewrite, the java application server receiving the HTTP request has no visibility to the original form or the URL.  It seems the only way to do is to have a rewrite rule in Apache that sends all inbound old style URLs to a servlet that builds a pretty URL and issues a permanent redirect.
 
Thanks for the input.
 
David
 
 
----- Original Message -----
Sent: Wednesday, May 11, 2005 9:36 AM
Subject: [Juglist] URL Rewrites

Two things: 
 
1)  I posted earlier about URL Rewrites and someone responded asking if I could comment on some rewrite strategies.  I've lost that email address, but I'd be happy to if you'll just respond to this post.
 
2)  I have apache rewrite rules in action rewriting URLs and forwarding them to my servlet.  I need to check for old URL's that may have been book marked and redirect them.  Is there a way for the servlet to access the original form of the HTTP request, i.e. prior to being rewritten. 
 
I don't see how this could be since the rewrite happens in Apache and there is nothing obvious in the HTTP header that indicates the original form of the request.  I thought I would ask though.
 
Thanks,
David Cooper
 
 
 
 


_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org
_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to