I have two domains on the same server. One domain is for production and the other is for testing content before it is copied over to the production. I am trying to create a rewrite rule that redirects http to https. How can I write it so that domain name is not hard coded? The reason I need this is when I copy the tested content to the production server I don't want have to change the .htaccess file. Here is what I have but it doesn't work.
# Prevent SSL cert warnings <IfModule mod_rewrite.c> RewriteCond %{SERVER_PORT} !^443 RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule>