1

In my website i get ssl for www.domain.com. i open using this its worked fine, when i use domain.com it show security exception how to resolve that

i used url rewrite in my standalone.xml file like below but it not worked for me

<virtual-server name="default-host" enable-welcome-root="false">
    <alias name="domain.com"/>
    <alias name="www.domain.com"/>
    <rewrite pattern="^(.*)$" substitution="https://$1" flags="R=301,L">
        <condition test="%{HTTP_HOST}" pattern="^www\.(.+)$" flags="NC"/>
    </rewrite>
</virtual-server>

please let me know if i did anything wrong?

Ramaraj
  • 146
  • 6

1 Answers1

1

its worked fine after this changes

<rewrite pattern="^(.*)$" substitution="https://www.domain.com$1" flags="R=301,L">
                <condition test="%{HTTP_HOST}" pattern="!^www\.domain\.com$" flags="NC"/>
            </rewrite>
Ramaraj
  • 146
  • 6
  • under the virtural-server tag add this rewrite content, substutation attr set url and condition tag check the hostname, pattern add the www falg NC non casse-sensitive – Ramaraj Jun 30 '14 at 10:00