Skip to content
Advertisement

How to redirect HTTP to HTTPS using XAMPP

I’m trying to redirect HTTP to HTTPS using XAMPP.
I’ve already seen all questions and multiple answers on multiple websites recommending this website: XAMPP: SSL Encrypt the Transmission of Passwords with HTTPS | Rob’s Notebook

This is what I did:


I uncommented the line:

JavaScript

in C:/xampp/apache/config/httpd.conf by removing the # in front of it.

Then I typed this inside of C:/xampp/apache/config/extra/httpd-xampp.conf:

JavaScript

I triple-checked that I did everything correctly, I saved everything, and I restarted XAMPP, but still, I’m not able redirected to HTTPS. Please Help!

Advertisement

Answer

I found the answer myself; I had vhosts setup and I had to place

JavaScript

Inside the directory I want redirected in C:/xampp/apache/config/extra/httpd-vhosts.conf.

This explained in the last few lines of robs notebook:
One thing to keep in mind with this redirection is that if you have virtual hosts, you need to place the redirection code (with the RewriteCond and RewriteRule) inside of your virtual host declarations, otherwise the redirection won’t work.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement