mod_rewrite: redirect to specified port on Host value of request header

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule  ^/(.*)$ http://localhost:3001/$1 [P]

Leave a Reply

Your email address will not be published. Required fields are marked *