首页 > 解决方案 > 在 APACHE 中不使用协议进行重定向

问题描述

我想编写一个 httpd 配置重定向,从某个页面到另一个页面,但不强制加密协议(http/https),我尝试了多个示例,尽管它们都不起作用。我的一些想法:

1) 开启重写引擎

RewriteCond "%{HTTP_REFFERER}"  "^/something/$"
RewriteRule "^/something/$" "%{REQUEST_SCHEME}example.com/test/test1.html" 

2)我希望能以某种方式工作

RewriteRule "^/something/$"   
"%{REQUEST_SCHEME}example.com/test/test1.html.html" [R=301] 

3)什么工作,但正如你所见,我必须使用 http 或 https,这是我不想要的 RedirectMatch 301 "^/something/$" "http://example.com/test/test1.html.html"

标签: apachewebserver

解决方案


推荐阅读