[英]redirect all requests to another domain using .htaccess but keeping the original url
[英]Redirect from 1 sub domain to another keeping the original url
我正在使用 plesk 服務器,並且設置了以下子域:
products.domain.co.uk 客戶名稱.domain.co.uk
我想指出以下幾點:
clientname.domain.co.uk/donations/id/clientname.domain.co.uk/forms/id/
到 products.domain.co.uk
並訪問正確的文件夾,傳入 id 查詢,但將原始域保留在 url 中。
我試過 .htaccess 但我得到 SSL 代理錯誤。
誰能指出我正確的方向來實現這一目標,或者有其他方法可以做到這一點。
這是我嘗試過的:
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{REQUEST_URI} ^/donations
RewriteRule ^(.*)$ https://products.domain.co.uk/donations/ [P]
這是我從 plesk 日志中得到的錯誤
錯誤 [為 clientname.domain.co.uk:443 請求 SSL 代理但未啟用 [提示:SSLProxyEngine]
錯誤 HTTPS:無法啟用 ssl 支持...。
謝謝
如果這對其他人有幫助,我設法找到了解決方案。 我在 Apache 和 nginx 設置下的 plesk 中添加了以下內容。
location ~ / {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://subdomain1.domain.co.uk;
proxy_redirect https://subdomain2.domain.co.uk https://$host/;
}
希望這對其他人有幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.