【问题标题】:Url is redirects to .shtml unknown link网址重定向到 .shtml 未知链接
【发布时间】:2019-05-28 12:06:37
【问题描述】:

我需要实现 SSL 重定向。 HTTP/https 和非 www URL 应强制重定向到 https://www URL。

htaccess 文件中存在浏览器验证码,这就是重定向到https://exmpledomain/.shtml的原因

【问题讨论】:

标签: .htaccess http url https http-status-code-401


【解决方案1】:
After the Authentication code please write this

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ ([^\ ]+)
RewriteRule ^ https://www.%{HTTP_HOST}%2 [L,R=301]

RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ ([^\ ]+)
RewriteRule ^ https://%{HTTP_HOST}%2 [L,R=301]

【讨论】:

    猜你喜欢
    • 2021-07-20
    • 1970-01-01
    • 2018-10-25
    • 1970-01-01
    • 1970-01-01
    • 2017-04-05
    • 1970-01-01
    • 2021-10-21
    • 1970-01-01
    相关资源
    最近更新 更多