【问题标题】:Free Shared SSL Certificate redirect using .htaccess to Parked Domain使用 .htaccess 将免费共享 SSL 证书重定向到停放域
【发布时间】:2015-08-23 15:51:07
【问题描述】:

您好,我在我的网站上使用 go location 并注意警告消息:

getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用,并且支持将在未来被删除。您应该考虑将应用程序切换到安全源,例如 HTTPS。详情请见https://goo.gl/rStTGz

使用 jushost,您可以获得免费的共享 ssl 证书: https://my.justhost.com/cgi/help/126

所以我设置了这个我的链接是这样的 https://justxxx.justhost.com/~justxxx/office/index.php。这是一个停放的域。当用户输入 http//office.xxxx/index.php 我想显示的问题 https//office.xxxx/index.php 中的地址将重定向到https://justxxx.justhost.com/~justxxx/office/index.php。不知道该怎么做。我认为它可以在 .htaccess 文件中完成,但我有点迷茫。 任何帮助都会很棒 谢谢 乔恩

【问题讨论】:

    标签: .htaccess redirect https ssl-certificate subdomain


    【解决方案1】:

    这应该适合你。阅读其中的 cmets。我无法完全理解您要做什么,但是如果您尝试将 http 重定向到 https,这将起作用。

    RewriteCond %{HTTPS} off
    # First rewrite to HTTPS:
    # Don't put www. here. If it is already there it will be included, if not
    # the subsequent rule will catch it.
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Now, rewrite any request to the wrong domain to use www.
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

    编辑1: 如果您只想重定向该特定网址。看到这个问题:.htaccess https redirect for a single page (using relative urls)

    【讨论】:

    猜你喜欢
    • 2016-11-12
    • 1970-01-01
    • 2019-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-14
    • 1970-01-01
    • 2011-02-12
    相关资源
    最近更新 更多