这应该是
# .htaccess file contents# Apache has the same docroot as the Java web app.# Java webapp is running on port 8084<IfModule mod_rewrite.c>RewriteEngine OnRewritebase /# For sites running on a port other than 80RewriteCond %{HTTP_HOST} !^domain.com [NC]RewriteCond %{HTTP_HOST} !^$RewriteCond %{SERVER_PORT} !^80$RewriteRule ^/(.*) http://domain.com:%{SERVER_PORT}/ [L,R]# And for a site running on port 80RewriteCond %{HTTP_HOST} !^domain.com [NC]RewriteCond %{HTTP_HOST} !^$RewriteRule ^/(.*) http://domain.com/ [L,R]</IfModule>
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
雄猫您可以在Tomcat中使用UrlRewriteFilter。这样的规则应该在
/WEB-INF/urlrewrite.xml中 为您工作:
<rule enabled="true"> <name>Force HTTPS example</name> <note>Automatically redirects user requests.</note> <from>http://domain.com/(.*)$</from> <to type="permanent-redirect" last="true">http://www.domain.com/</to></rule>
不知道我是否打错了,写在头上
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)