我怎样才能打开https到所有页面,而不是通过.htaccess的frontpage,任何人都可以帮助我进行重写。
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=302,L]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]我已经有了,我的目标是排除HTTPS的FRONTPAGE,只有内部/子页面应该有HTTPS。
请帮我修改一下我现有的。谢谢。
发布于 2014-01-12 07:31:49
您可以使用以下规则:
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.+)$ https://www.mydomain.com/$1 [R=301,L,NE]
RewriteCond %{HTTPS} on
RewriteRule ^$ http://www.mydomain.com/ [R=301,L]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA].+而不是.*确保除头版之外的其他子页面强制使用http。
https://stackoverflow.com/questions/21072229
复制相似问题