Vyřešeno — vlákno je tím uzavřené a další odpovědi do něj nepřibývají.

Otázka

AW185650
AW185650 Zákazník WebSite Vyřešeno

HTTP and WWW to HTTPS redirect

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;“

0

5 odpovědí

JP328023
JP328023 Podpora

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?

0
MB313456
MB313456 Podpora Přijatá odpověď

Hello, the code we recommend is

[apcode language=“php“]

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

[/apcode]

just below

[apcode language=“php“]

RewriteEngine On

[/apcode]

in the www folder.

O uživateli: VEDOS Specialista na Znalostní bázi Web: kb.vedos.cz
0
AW185650
AW185650 Zákazník

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

0
MB313456
MB313456 Podpora

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

O uživateli: VEDOS Specialista na Znalostní bázi Web: kb.vedos.cz
0
AW185650
AW185650 Zákazník

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

0

Máte stejný problém?

Tohle vlákno je uzavřené a odpovídat už v něm nejde. Když vám odpověď nestačí nebo se vás týká něco jiného, položte vlastní dotaz — odkaz na tohle vlákno do něj klidně vložte.