Windows - Direct HTTP to HTTPS (for MediaWiki)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Windows - Direct HTTP to HTTPS (for MediaWiki)

Postby userapache123 » 21. July 2021 18:28

Can you please suggest to me the steps so that all the HTTP paths get redirected to the HTTPS (port 443) with a certificate for the MediaWiki installed in the Windows server?

The application (MediaWiki) currently works with HTTP as http://myserver1:8082

I have obtained an SSL certificate (key, crt files) and did various read-ups.

One suggestion was to keep every configuration as is (so that it continues using HTTPS on port 8082) but to add a single line in httpd-vhosts.conf to do the redirect as follows (whenever it sees mywiki in the URL, it will redirect to HTTPS:

<VirtualHost *:8082>
ServerName myserver1:8082

Redirect "/mywiki/" "https://mywiki.org/"
</VirtualHost>

Also, add a second entry in httpd-vhosts.conf as:

Listen 443
<VirtualHost *:443>
DocumentRoot "C:/Xampp/htdocs/mywiki"
ServerName www.mywiki.com
SSLEngine on
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<Directory "C:/Xampp/htdocs/mywiki">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

I will do the necessary domain name re-mapping outside the Apache server.

I have not made any changes to httpd-ssl.conf. The httpd.conf indeed includes it (Include conf/extra/httpd-vhosts.conf), also enabled is (LoadModule ssl_module modules/mod_ssl.so).

I am using:
I am using in Windows server:
MediaWiki 1.35.2
Apache 2.4.47 Win64 from Xampp
mysql-8.0.23-winx64 (MySQL :: Download MySQL Community Server)
PHP 7.4.3

Can you please suggest the steps needed to direct all the web pages from HTTP to HTTPS?
userapache123
 
Posts: 14
Joined: 06. May 2021 06:01
XAMPP version: xampp-windows-x64-7.4.16-0-VC1
Operating System: Windows

Re: Windows - Direct HTTP to HTTPS (for MediaWiki)

Postby Nobbie » 22. July 2021 21:39

userapache123 wrote:so that it continues using HTTPS on port 8082


You cannot run both http and https on the same port.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 136 guests