samedi 6 octobre 2018

Why does this redirect to a wrong URL?

I am trying to redirect all traffic to HTTPS and WWW.

Using this in my .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

But going to my domain example.com/blog redirects to https://www.example.comblog

This does not have a slash after the domain before the subdirectory.

Any suggestions?




Aucun commentaire:

Enregistrer un commentaire