【问题标题】:Redirect a single page from HTTPS to HTTP将单个页面从 HTTPS 重定向到 HTTP
【发布时间】:2014-11-17 12:42:03
【问题描述】:

我有一个完全在 HTTPS 上运行的网站。并且有一个文件不需要在 HTTPS 中加载。因此,我尝试将其从 htaccess 重定向,但没有成功。

RewriteCond %{HTTPS} on
RewriteRule ^xml$ http://mysite/api.php [L,R=301]

以下是我尝试过的行,但它们不起作用。

我也试过这个,但结果是负面的。 HTTPS to HTTP htaccess redirect for home page only

【问题讨论】:

  • 你不想在 HTTPS 上使用哪个 URL?
  • @anubhava https://mysite/xml 到 http://mysite/xml 而所有其他页面都作为 https://mysite/*
  • 但是为什么你的目标中有/api.php?你能展示你的完整 .htaccess 吗?

标签: php .htaccess http redirect https


【解决方案1】:

您可以只使用简单的 301 重定向。把它放在你的 .htaccess 中

redirect 301 /api.php http://mysite/api.php

这应该可行,因为它只是在 https 或 http 上获取 api.php 文件并告诉它转到

【讨论】:

    猜你喜欢
    • 2018-03-19
    • 1970-01-01
    • 2023-03-03
    • 2013-10-18
    • 1970-01-01
    • 1970-01-01
    • 2014-03-19
    • 2013-04-15
    • 2016-12-12
    相关资源
    最近更新 更多