htaccess subdomain redirect to port while keeping original url
问题 I have trouble getting this to work properly, what I'm trying to do is make http://subdomain.domain.com redirect to domain.com:8080 while keeping the original url "subdomain.domain.com" Code so far: RewriteEngine on RewriteCond %{HTTP_HOST} subdomain.domain.com RewriteRule ^(.*)$ http://%1domain.com:8080$1 [L] Which does the redirect, but browser url changes to "http://domain.com:8080" which is not what I seek. Thank you in advance! 回答1: For this to happen you need to enable mod_proxy in