简体   繁体   English

重定向域,但保留原始网址

[英]Redirect domain but keep original url

I'm trying to use .htaccess with the proxy tag to redirect owncloud.example.com to owncloud.example.com:7777/owncloud but i need the url in the adressbar to remain unchanged. 我正在尝试将.htaccess与代理标签一起使用,将owncloud.example.com重定向到owncloud.example.com:7777/owncloud,但是我需要adressbar中的网址保持不变。

This is my current htaccess 这是我目前的htaccess

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^owncloud\.example\.com [NC]
RewriteRule (.*) http://owncloud.example.com:7777/owncloud [P,L]

However with this configuration I get Proxy Error 502 when i try to browse to the web page. 但是,使用此配置,当我尝试浏览到网页时,出现代理错误502。

I have mod_rewrite and mod_proxy enabled. 我启用了mod_rewrite和mod_proxy。

Looks like it needs the rest of the path info. 看起来它需要其余的路径信息。 You may also need to configure owncloud so that it thinks it's at http://owncloud.example.com/ . 您可能还需要配置owncloud,使其认为它位于http://owncloud.example.com/ Try this: 尝试这个:

RewriteRule .* http://owncloud.example.com:7777/owncloud/$0 [P,L]

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

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