【发布时间】:2019-02-15 05:16:18
【问题描述】:
我正在尝试将重写规则添加到我的 apache 配置文件中,以将用户重定向到新的 url。
我网站的网址是https://openmind.scribesoftware.com。如果用户输入带有 https://openmind.scribesoft.com 的 URL(注意缺少“ware”),我想重定向他们,就好像他们输入了正确的 url。
我尝试了几种变体,例如:
RewriteEngine on
RewriteCond %{HTTPS_HOST} !^openmind\.scribesoft\.com$ [NC]
RewriteRule ^(.*)$ https://openmind.scribesoftware.com/$1 [R=301,L]
但是这会导致以下错误:
This webpage has a redirect loop.
The webpage at https://openmind.scribesoftware.com//enterprises/571 has resulted in too many redirects.
我已经有一个重写规则来将非 http 请求重定向到 https 请求,并且工作正常。
谢谢。
【问题讨论】:
-
@Spob - 请接受答案。完美解决问题。
标签: apache