在某些页面上将 http 直接转换为 https?
您好,我已将以下代码添加到 .ht 访问中,但如何添加另一个页面?例如login.php
,如果用户输入www。他们得到“不受信任的连接”,因为 SSL 仅在没有 www 的情况下才有效。我该如何解决这个问题?
谢谢
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} /login.html
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Hi I have added the below code to .ht access but how can I add another page to this? such as login.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}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的第一个问题并没有真正提供编写重写规则所需的信息。您希望根据什么标准将它们重定向到 login.php?
至于 SSL 问题;
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;
这种方式对于我的个人博客页面非常有用,
我将此代码添加到 .htaccess
重写引擎开启
重写条件%{SERVER_PORT} 443
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
祝你好运,谢谢,
Belajar 网络营销
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