views:

33

answers:

1

I have already built a site with a strong page ranking in Google, but I started with too many subdomains, so I've re-worked the code so that it can all be one a single domain.

I have created a separate app which ought to simply act as a filter, permenantly redirecting all requests made to sub1.mydomain.com/something?id=hi to anotherdomain.com/sub1/something?id=hi. What's the best way to do this? I've tried writing a servlet but it doesn't like the url-pattern /* and I have a feeling this ought to be done as a filter, but I can't get it to work like that either. What's the easiest way to do this in Java?