Mapping .pl to .jsp in war archive

Hi, I am new to all this so this is probably a stupid question, but I want to start serving my website using tomcat. I have rewritten the perl scripts (xyz.pl) in jsp (xyz.jsp).

What is the best way to make sure that links from google dont break? I would prefer the link xyz.pl to still work, but all sublinks link to a jsp page?

ie, i want the xyz.pl to be alias to xyz.jsp? I think? Is this possible somehow?

[429 byte] By [jasmia] at [2007-11-26 14:11:24]
# 1

I think you could use the Apache Redirect directive (more specifically the RedirectMatch directive). You will need to use the Tomcat Connectors to connect Apache (web server) to Tomcat. The Alias and ScriptAlias directives are used to map between URLs and filesystem paths so I'm guessing that is not what you want.

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirect

EDIT: you might want to look at mod_rewrite too

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

YoGeea at 2007-7-8 1:59:26 > top of Java-index,Java Essentials,New To Java...
# 2

It's been a while since I had to futz with deployment descriptors...

but I think it may be possible to set up your deployment descriptors to tell it to interpret any .pl file as a JSP.

So what you could do is create JSP pages for each existing .pl URL on your site. Then just rename the JSP pages so they end with .pl. So they're just like any other JSP pages; they just happen to have a non-intuitive filename extension, and they just happen to have paths which are identical to some paths on your old site.

Of course this would be a temporary solution -- you'd want to support the .jsp extension as well, and you'd want all the links on your site to use .jsp URLs.The main URL (/) should also refer only to JSP pages. So after a while Google will reindex your site. After a month or so check your log files and see if anyone is still going to .pl URLs; if not you can remove them.

But really I like YoGee's solution better. If the redirects are set to be 301's (not 302's) then that should theoretically tell Google and anyone else linking to your site, to change their URLs to the new value. Using 301 redirects is the direct approach. Forget I mentioned this.

paulcwa at 2007-7-8 1:59:26 > top of Java-index,Java Essentials,New To Java...