![](/img/trans.png)
[英]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.