I want to force Apache to redirect all traffic through HTTPS:
# Redirect HTTP traffic to HTTPS.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://mypublicip/$1 [R=301,L]
Unfortunately, this does not work when I am trying to access my website from my local network using my Web server's private IP. How could I work around this limitation?