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 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)