HTAccess Forward HTTP to HTTPS

ID - _BUGFISH - E#42
^Top
<< Back
Mobile-Menu










HTAccess Forward HTTP to HTTPS
Category: HTACCESS
Sub-Category:
Creator: Jan-Maurice Dahlmanns
Created: 2020-08-26 01:19:39
Modified: 2024-11-22 04:23:56
Views: 738

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.

If you put this in your htaccess, the server will forward all request from HTTP to HTTPS
(with all details after the domain included like get variables)
It will also rewrite all www.yourdomain.de requests to yourdomain.de.
So its not possible to create 2 sessions on the same website.

Replace yourdomain.de with your own domain which is needed.

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.de [NC]
RewriteRule ^(.*)$ https://yourdomain.de/$1 [L,R=301]
Currently 0 Upvotes!

captcha image
System - 2024-11-05 18:28:46
Commenting System Initialized! Have a very nice day!

Switches: 0 | Arrivals: 9 | Visits: 9
This Website is using Session Cookies for Site Functionality.