Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] MovedContextHandler

thanks Joakim.

that got me a little further, but I am still not able to do exactly what I want.

if the request comes in from 80, I need to redirect to https.  I was able to do that using the @name
but if it comes in from https, I only want to redirect to www like https://domain.com -> https://www.domain.com

I think I would need a combination of 2 criteria, but if I do that below either would match.  I need it to work only if both criteria are met. (the @connectorName and the virtual host mydomain.com)

how could I do that?

Thanks,
Eric

<Configure class="org.eclipse.jetty.server.handler.MovedContextHandler">
  <Set name="contextPath">/</Set>
  <Set name="newContextURL">https://www.mydomain.com</Set>
  <Set name="permanent">true</Set>
  <Set name="discardPathInfo">false</Set>
  <Set name="discardQuery">false</Set>
  <Set name="virtualHosts">
    <Array type="String">
          <Item>@httpsConnector</Item>
          <Item>mydomain.com</Item>
    </Array>
  </Set>
</Configure>

Back to the top