.htaccess - How to disable (?code=$1) | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

.htaccess - How to disable (?code=$1)

I'm trying to make a domain automatically https, but when I do that the url changes itself from: /index to /index.php?code=$1 ($ 1 is the code name) How can i fix this? Please let me know! EXAMPLE CODE (.htaccess): RewriteEngine On RewriteRule ^([A-Za-z0-9]+)$ redirect.php?code=$1 RewriteCond %{ENV:HTTPS} !on [OR] RewriteCond %{HTTP_HOST} !^example.com$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

21st Nov 2018, 2:03 PM
Wesley de Bruin
Wesley de Bruin - avatar
2 Antworten
0
This code should force everything to load https. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
27th Nov 2018, 12:10 AM
Mike
0
Thanks, but that's not the question :p
25th Dec 2018, 5:38 PM
Wesley de Bruin
Wesley de Bruin - avatar