I am pretty computer savvy, but not with setting up web servers. I have a domain name that has an SSL certificate, so that https://example.org works and http://example.org redirects there. BUT, http://[the bare IP address] returns an insecure http version of example.org (same content). My goal is to have http://[bare IP] redirect to https://example.org. I believe we have an "elastic IP" i.e. a static IP that points to some EC2 instance.
I am running a bitnami wordpress ... "thingy" (instance? service? dunno the right term), on Ubuntu, on an AWS EC2 instance. I have tried various things in /opt/bitnami/apache2/conf/httpd.conf to redirect the IP, all have failed. I won't post what I've tried since it's from random webpages and "voodoo" (just type this and hope), to no luck. I'd rather start fresh and do it "the right way."
I gather one has to restart the apache service for changes to httpd.conf to take effect, and I've been doing this. I also turned on heavy error logging, and know where the logs are, but can't make much sense of them.
Explicit steps along the lines of "edit this file with these lines, restart apache, refresh http://[bare IP] in Firefox, the lock w/ the red slash left of the address should now have no slash" are greatly appreciated.
Here is the only content I manually added to httpd.conf (to answer a comment), and with actual Ip addr and domain name changed:
<VirtualHost *:80>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^N1\.N2\.N3\.N4$
RewriteRule ^(.*)$ https://testing.example.org/$1 [R=301,L]
</VirtualHost>