I just exhausted all resources and nothing seems to be working. I built an Apache web server in FreeBSD 9, put the rewrite module in the /usr/local/etc/apache22/extra/httpd-default.conf. I even created the .htaccess file and placed it in /usr/local/www/apache22/data, which is the same location where the index.html file is stored. Whenever I put in the IP address of the web server in a web browser on another computer, I get the web page but with http://, Not https://. How do I fix this. Here's what I have been putting in the files
/usr/local/etc/apache22/extra/httpd-default.conf
and
/usr/local/www/apache22/data/.htaccess
I put them inside the files exactly as they seem and none of them are working, I still get directed to the http:// page instead of the https:// page.
/usr/local/etc/apache22/extra/httpd-default.conf
and
/usr/local/www/apache22/data/.htaccess
Code:
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Code:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
I put them inside the files exactly as they seem and none of them are working, I still get directed to the http:// page instead of the https:// page.