[英]Redirect to a different apache server for a Domain but keep URL the same
[英]Redirect but keep the domain the same
我有一个owncloud服务器,我想设置第二个短域,以使共享链接短。
可以说我们有longdomain.com和short.com这是我的httpd行
<VirtualHost *:80>
ServerAdmin email@adderss.com
DocumentRoot /var/www/dir/public_html
ServerName short.com
ServerAlias www.short.com
RewriteEngine on
RewriteRule ^/([A-Za-z0-9]{4,12})$ https://www.long.domain.com/public.php?service=shorty_relay&id=$1 [QSA,L]
ErrorLog /var/www/dir/error.log
</VirtualHost>
在当前行中,short.com完全重定向到我需要的位置,但是我希望此重定向位于后台,并在用户的浏览器中保留短域名。 我怎样才能做到这一点?
更新:
在我的短域虚拟主机中,我可以使用短域访问我自己的云。 例如:short.com/index.php/apps/files/
长域消失了。 我认为我现在向前迈了一步。
ProxyPass / https://www.long.domain.com
ProxyPassReverse / https://www.long.domain.com
下一步是使用正则表达式,这样我就只能加载短ID链接。
如何将上面的重写正则表达式与proxypass结合使用。 我已经尝试了ProxyPassMatch,但还没有弄清楚如何正确使用它,有什么想法吗?
如果无法使short.com寻址相同的内容,则short.com可以通过加载mod_proxy,mod_proxy_http并将重写标志从R更改为P来代理长域。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.