.htaccess redirect to external URL while hiding redirect

前端 未结 5 2227
醉梦人生
醉梦人生 2020-12-18 06:56

I want to be able to redirect a domain pointed to my webhosting to an external domain.

For example, I have this in my .htaccess:

RewriteCond %{HTTP:         


        
5条回答
  •  既然无缘
    2020-12-18 07:31

    None of the other answers suggested this. What op is looking for is mod-proxy . You can proxy the request from your domainA to domainB using P flag of mod-rewrite.

    RewriteRule ^(.*)$ http://domainB.com/$1 [P]
    

    This will internally redirect all requests from domainA to domainB.

    Make sure mod-proxy is enabled on your server.

提交回复
热议问题