简体   繁体   English

在同一Apache中将https重定向到https

[英]Redirection https to https within same Apache

I have a requirement where I have to redirect my hostname to particular application which is again hosted on same Apache. 我有一个要求,我必须将主机名重定向到再次托管在同一Apache上的特定应用程序。 Let's take an example, When I hit on host( https://domain1.example.com ), It should internally redirect me to Apache Web Application ( https://domain1.example.com/application1 ) without changing the browser URL. 让我们举个例子,当我点击主机( https://domain1.example.com )时,它应该在内部将我重定向到Apache Web应用程序( https://domain1.example.com/application1 ),而无需更改浏览器URL。

I am not sure how to achieve SSL to SSL redirection. 我不确定如何实现SSL到SSL的重定向。 Thanks in Advance..!!! 提前致谢..!!!

This should work. 这应该工作。 This will redirect all incoming urls that are going to domain1.example.com/ to domain1.example.com/application1 这会将所有进入domain1.example.com/的传入URL重定向到domain1.example.com/application1

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.example.com$
RewriteRule ^$ https://domain1.example.com/application1 [L,R=301]

If without changing browsing URL is your goal then PROXY is your way. 如果不更改浏览URL是您的目标,那么PROXY是您的方式。

Put following in your apache vhost or global file, 将以下内容放入您的apache虚拟主机或全局文件中,

ProxyPass https://domain1.example.com/ https://domain1.example.com/application1
ProxyPassReverse https://domain1.example.com/ https://domain1.example.com/application1

PS shibboleth has nothing to do with this, at least you have not mentioned any case. PS shibboleth与此无关,至少您没有提到任何情况。

EDIT 编辑

  1. ProxyPass should come to virtural host not in location ProxyPass应该到达不在location虚拟主机

  2. Ideally all the location tag should be out of virtual host 理想情况下,所有location标签都应位于virtual host

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM