Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My current setup has two virtual-servers, my-server redirects to the domain with www. prefix.

<virtual-server network-listeners="my-nlistener" id="my-server" sso-cookie-http-only="false" hosts="">
  <property name="redirect_1" value="from=/my-page.jsp url-prefix="/>
  <property name="redirect_2" value="from=/about.jsp url-prefix="/>      
<virtual-server network-listeners="my-nlistener" id="my-new-server" sso-cookie-http-only="false" hosts="">      

Unfortunately, for SEO compliance, I need to do 301 redirects and not 302

How do I force 301 redirects in GlassFish like in Apache? Or is it a better practice to keep only one virtual-server and have multiple hosts as such : <virtual-server id="my-new-server" hosts=",">.

I would love to avoid creating a Spring application to do 301 redirects for the specified pages.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.