0
我有我的网站上的某些页面使用HTTP和HTTPS使用其他页面。现在我想使用mod_rewrite将www附加到所有URL,无论它们是使用http还是https。附加WWW在URL HTTP和HTTPS
我有我当前的代码在.htaccess:
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index.php
RewriteCond $1 !^(index\.php|public|assets|robots\.txt)
RewriteRule ^(.*)$ ./index.php/$1 [L]
请只专注于前两行的其余为其他重写规则,但我把它的情况下,他们造成了我的第一个任何错误2行。
现在这会将所有的页面的HTTP,但我想用HTTPS页面重定向到正确的协议。我试图解决在计算器上(htaccess redirect for non-www both http and https)线程,但它并没有为我工作。
嗯,我真的不知道你的意思,但我可以在现场使用https,这只是mod_rewrite的没有按出于某种原因,不能正确重定向。 – peter 2011-03-23 02:19:36
通过了mod_ssl或别的东西被服务的HTTPS? – easel 2011-03-23 02:55:29