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:
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.