开发者

direct http to https on certain pages?

开发者 https://www.devze.com 2022-12-11 12:37 出处:网络
Hi I have added the below code to .ht access but how can I add another page to this? such as login开发者_Go百科.php

Hi I have added the below code to .ht access but how can I add another page to this? such as login开发者_Go百科.php

also if the user types in www. they get a "untrusted connection" as the SSL is only valid without the www. how could I fix this?

Thanks

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /login.html
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


Your first question doesn't really give the required information to write the rewrite rule. Upon what criteria do you want to redirect them to login.php?

As far as the SSL issue;

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} != on
RewriteRule ^(.*)$ https://$1 [L]


This way is very useful for my personal blog page

i'm add this code to .htaccess

RewriteEngine On RewriteCond %{SERVER_PORT} 443 RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Good Luck and Thanks,

Belajar Internet Marketing

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号