Score:0

Apache 2.4 i WAMP redirect from http to https not working

cy flag

I am using wamp server in windows(Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.12). I have successfully installed SSL certs. Now https is working without any issue. But http redirection is not working.

<VirtualHost *:80>
ServerName test.com
ServerAlias www.test.com
Redirect permanent / https://test.com/

</VirtualHost>

<VirtualHost *:443>
ServerName test.com
ServerAlias www.test.com
DocumentRoot "C:/wamp64/www/test"
<Directory "C:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.41/conf/key/fullchain.pem"
SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.41/conf/key/privkey.pem"
SSLCertificateChainFile "C:/wamp64/bin/apache/apache2.4.41/conf/key/fullchain.pem"
</VirtualHost>

when I am trying to access it using http, I am getting bad request error.

Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

Could you please help me figure out this one?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.