views:

5405

answers:

5

I would like to redirect/rewrite this two kinds of URLs:

  • mydomain.com -> newdomain.com
  • mydomain.com/specificPage -> newdomain.com/newSpecificPage
  • mydomain.com/anyOtherPage -> mydomain.com/anyOtherPage (no redirect here)

So I just want to redirect the root domain to a new domain, and some pages from my domain to some pages on a new domain...

How can I do that on a JBoss server ?

+2  A: 

Have you looked into http://www.jboss.org/file-access/default/members/jbossweb/freezone/modules/rewrite/index.html? It looks like what you're looking for, and it's pretty similar to Mod_rewrite for Apache.

f4nt
A: 

Sounds like you want to send an HTTP 301 Moved Permanently response.

RewriteCond %{REQUEST_URI} ^URI_TO_REDIRECT
RewriteRule redirect=301 NEW_SITE [L]

or similar. The [L] is to tell it to redirect immediately instead of continuing to rewrite.

Hank Gay
+2  A: 

You might take a look at this http://code.google.com/p/urlrewritefilter/

Alexandre Victoor
A: 

If you are routing through apache at all it is possible to use mod_rewrite; you just need to be careful as to where you declare the rewrite rules. Directory configs and .htaccess files won't work; you need it as a global configuration for the entire host. Similar thread on serverfault.

Antitribu
A: 

i am using jBoss as application server, i want to do url rewriting, as

url like... /product.do?title=digitaltv rewrite to... /product/digitaltv

Please help, i am new to jboss server!

Aman