【发布时间】:2012-12-11 15:42:31
【问题描述】:
我希望设置 2 次 .htaccess 重写,但不确定它们的实际外观:
http://www.mysite.com -> http://www.myothersite.com:880
和
https://www.mysite.com -> https://www.myothersite.com:4443
只是为了处理端口转发问题...
这是我目前正在尝试的:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^cloud\.mysite\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteRule ^ http://mysite.no-ip.org:880%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^cloud\.mysite\.com$ [NC]
RewriteCond %{HTTPS} on
RewriteRule ^ https://mysite.no-ip.org:4443%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/joomla" [R=301,L]
【问题讨论】:
标签: regex apache .htaccess mod-rewrite portforwarding