OpenShift和重定向在.htaccess [英] OpenShift and redirect in .htaccess

查看:145
本文介绍了OpenShift和重定向在.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字preSS应用程序部署到OpenShift和有关的域别名,即www.example.org。现在,我想补充的另一个别名,即www.example2.org,优雅地重定向来自www.example.org => www.example2.org所有的请求。 我试图做到这一点通过的.htaccess:

I have a Wordpress app deployed on OpenShift and a domain alias associated, i.e. www.example.org. Now I would like to add another alias, i.e. www.example2.org, and gracefully redirect all the request from www.example.org => www.example2.org. I tried to do this via .htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.org$
RewriteRule (.*)$ http://www.example2.org/$1 [R=301,L]

每当接触www.example.org它产生的重定向一个无限循环,我不明白为什么。

Whenever contact www.example.org it generates an infinite loop of redirects and I can not understand why.

推荐答案

Openshift重写重定向头,但你可以通过添加端口号的URL prevent这一点。查看更多这里

Openshift rewrites the redirect header, but you can prevent this by adding the port number to the URL. See more here.

这篇关于OpenShift和重定向在.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆