【问题标题】:Forward one special http URL to https URL with port via htaccess通过 htaccess 将一个特殊的 http URL 转发到带有端口的 https URL
【发布时间】:2013-02-11 22:03:51
【问题描述】:

对于我们的网站,我们需要重定向以下登录 URL

http://lit.example.com/index.php?action=initLogon

https://lit.example.com:60558/index.php?action=initLogon

我在网上没有找到任何解决方案。

【问题讨论】:

    标签: .htaccess redirect ssl https url-rewriting


    【解决方案1】:

    您可以为此使用RewriteCondRewriteRule

    RewriteEngine On
    RewriteCond %{HTTPS} !on
    RewriteCond %{QUERY_STRING} action=initLogon
    RewriteRule ^/?index.php$ https://lit.example.com:60558/index.php [R,L]
    

    这会检查它是否是一个普通的 HTTP 请求,并查看查询字符串是否确实是action=initLogon。如果是,它会将客户端重定向到新的 HTTPS URL。

    【讨论】:

      猜你喜欢
      • 2016-08-23
      • 1970-01-01
      • 2015-02-13
      • 2011-08-29
      • 1970-01-01
      • 2014-03-15
      • 2013-07-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多