HTTP and WWW to HTTPS redirect

Vyřešeno757 zhlédnutíWebSitehtaccess Https Redirect
0

Hi team WEDOSI have noticed recently that on mhy domain websiteswanted.eu, the http:// and www. versions do not redirect correctly to https://
I have inserted the correct code (see below) in the domain .htaccess file, but it doesn’t seem to work.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301]
Header set Content-Security-Policy „upgrade-insecure-requests;“

Role: Zákazník
Otázka je uzamčena pro nové odpovědi.
MB313456 Vybral nejlepší odpověď 29. 3. 2023
0
91.75K Odpověď od WEDOS Internet, a.s. 0 Comments

Hello, the code we recommend is

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]
Header set Content-Security-Policy "upgrade-insecure-requests;"

just below

RewriteEngine On

in the www folder.

Role: Podpora Web: https://kb.wedos.com Vizitka: WEDOS Specialista na Znalostní bázi
MB313456 Vybral nejlepší odpověď 29. 3. 2023
0
3.64K Odpověď od WEDOS Internet, a.s. 0 Comments

Hello!

Thank you for reaching up to us.

Can you please tell me if you added these lines of code to the htaccess file located in /www on FTP?

Role: Podpora
JP328023 Edited answer 28. 3. 2023
0

Thank you. And should I delete the other .htaccess files (i.e. the ones in /domains and /websiteswanted ?

Role: Zákazník
MB313456 Změnil status na publikováno 29. 3. 2023
0
91.75K Odpověď od WEDOS Internet, a.s. 0 Comments

It shouldn’t matter, but if they only have the same code, I would suggest deleting them just in case.

Role: Podpora Web: https://kb.wedos.com Vizitka: WEDOS Specialista na Znalostní bázi
MB313456 Odpověděl na otázku 29. 3. 2023
0

Thanks very much for your help. This now seems to be working properly.

Role: Zákazník
MB313456 Změnil status na publikováno 29. 3. 2023