0

i have a domain which which is like www.mydomain.com

and i want to redirect all non www request requests to www except for https requests.

i am using this one, which is redirecting all requests to www

RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

what i want to do is, preventing redirects of requests like https://sslsites.com/mydomain.com

4

1 回答 1

0

添加以下内容(在 RewriteRule 之前):

RewriteCond %{HTTPS} off

Apache mod_rewrite 文档可在此处获得。

于 2013-08-23T13:53:45.997 回答