使用多个域和SSL重写Tomcat URL

使用多个域和SSL重写Tomcat URL,tomcat,url-rewriting,Tomcat,Url Rewriting,我的Tomcat7配置有问题;我以前使用tuckey URL重写库使用以下配置将非www和非https流量重定向到https+www URL: <rule> <name>Canonical Hostnames</name> <condition name="host" operator="notequal">^www.mydomain.net</condition> <condition name="host" ope

我的Tomcat7配置有问题;我以前使用tuckey URL重写库使用以下配置将非www和非https流量重定向到https+www URL:

<rule>
  <name>Canonical Hostnames</name>
  <condition name="host" operator="notequal">^www.mydomain.net</condition>
  <condition name="host" operator="notequal">^$</condition>
  <from>^/(.*)</from>
  <to type="permanent-redirect" last="true">https://www.mydomain.net/$1</to>
</rule>

规范主机名
^www.mydomain.net
^$
^/(.*)
https://www.mydomain.net/$1
我刚刚购买了域名的.com版本;并已成功为其设置SSL证书。我将上面的配置改为使用.com url&现在我希望所有.net流量、非www和非https都重定向到https+www+.com url。当前,当我访问.net版本的网站时,它不会重定向到.com&我在浏览器中看到ssl证书错误,因为很明显,该网站设置为使用.com ssl证书

任何帮助都将不胜感激——我不想把塔奇作为解决方案。 谢谢


规范主机名
^www.example.com
^$
^/(.*)
https://www.example.com/$1

我应该帮你。。只需将.net更改为.com即可。现在,任何不是www.mydomain.com的东西都将成为它。

我不知道有问题的库,但您提供的xml片段看起来好像可以有多个不同的规则,例如,每个域一个规则。这可能比依赖通配符更容易。如果这没有帮助,您可能希望发布.net/.com域的非工作配置,以便我们可以看到您已经尝试了什么。
<rule>
  <name>Canonical Hostnames</name>
  <condition name="host" operator="notequal">^www.example.com</condition>
  <condition name="host" operator="notequal">^$</condition>
  <from>^/(.*)</from>
  <to type="permanent-redirect" last="true">https://www.example.com/$1</to>
</rule>