dongshen3352 2017-12-04 23:52
浏览 47
已采纳

更改.htaccess中的规则后的不安全连接

I'm trying to set rules to change the URL from page contact.php to contact but the website now show unsafe connection in the main page but not on other pages.

This is the rule i used:

RewriteRule ^contact(.[A-Za-z0-9-]+)/?$ contact.php?=$1

While i still haven't set this clean URL yet, it's strange the website isn't using a secure connection anymore.

The link is here. Even if i clear the rule it is still unsecure and even if you write https:// in the URL, after navigating through other pages and back to the main page again it is not secure anymore.

Can you give me insight from this?

  • 写回答

2条回答 默认 最新

  • dpjj4763 2017-12-05 00:09
    关注

    I just checked your site. For every absolute URL you need to have https and not http as the protocol or use relative URLs. So please check your HTML a-tags. To also have the main site in https you should add another rewrite rule:

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

    Another thing is to fix the current contact regex to:

    RewriteRule ^contact([.A-Za-z0-9-]*)/?$ contact.php?=$1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 VB.NET2022如何生成发布成exe文件
  • ¥30 matlab appdesigner私有函数嵌套整合
  • ¥15 给我一个openharmony跑通webrtc实现视频会议的简单demo项目,sdk为12
  • ¥15 vb6.0使用jmail接收smtp邮件并另存附件到D盘
  • ¥30 vb net 使用 sendMessage 如何输入鼠标坐标
  • ¥15 关于freesurfer使用freeview可视化的问题
  • ¥100 谁能在荣耀自带系统MagicOS版本下,隐藏手机桌面图标?
  • ¥15 求SC-LIWC词典!
  • ¥20 有关esp8266连接阿里云
  • ¥15 C# 调用Bartender打印机打印