Thomas
Thomas

Reputation: 717

tomcat urlrewritefilter baseurl

guys

How to redirect http://airizu.com/ to http://www.airizu.com/

we use Tomcat as the JSP server, at the begining, we use http://airizu.com as the urls's root, and google index my sites aready.

but now, we want to use the one url root, you know http://www.airizu.com/.

so I have to use some urlrewrite to redirect url, the http code must be 301.

I research a lot of articles, and find a module: http://code.google.com/p/urlrewritefilter

how can use this module to do the url redirect ?

Upvotes: 1

Views: 2182

Answers (1)

Paul
Paul

Reputation: 628

Just install following instructions here: http://code.google.com/p/urlrewritefilter

Then add a rule that looks something like:

<rule>
    <name>Domain Name Check</name>
    <condition name="host" operator="notequal">www.example.com</condition>
    <from>^(.*)$</from>
    <to type="redirect">http://www.example.com/$1</to>
</rule>

This checks that users are using the correct domain name to get to your site. ie, users gong to example.com/blah will be redirected to www.example.com/blah

Upvotes: 3

Related Questions