Syl
Syl

Reputation: 131

How to rewrite an URL on a JBoss server?

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

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 ?

Upvotes: 13

Views: 34697

Answers (4)

f4nt
f4nt

Reputation: 2671

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

Upvotes: 11

Antitribu
Antitribu

Reputation: 111

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.

Upvotes: 0

Hank Gay
Hank Gay

Reputation: 71939

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.

Upvotes: 1

Alexandre Victoor
Alexandre Victoor

Reputation: 3104

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

Upvotes: 3

Related Questions