Hi all.
On a simple Quark install without much customization at system config level, all is working fine, including all redirections to https://, except redirections from WWW to non WWW for inside pages only.
Example:
Page
https://www.mydomain.com/mypage
will redirect to
https://mydomain.com/index.php
instead of
https://mydomain.com/mypage
Same behavior for
http://www.mydomain.com/mypage
and
www.mydomain.com/mypage
,
and same for all inside pages.
How can WWW be redirected to /index.php
???
Redirections in .htaccess are as follows, identical to on my other Grav sites :
# Remove trailing slash from non-filepath urls
RewriteCond %{REQUEST_URI} /(.+)/$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ https://mydomain.com/%1 [R=301,L]
# Include trailing slash on directory
RewriteCond %{REQUEST_URI} !(.+)/$
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)$ https://mydomain.com/$1/ [R=301,L]
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Error pages, as long as there is no WWW, correctly redirect from
nothing or http:// or https:// mydomain.com/error-slug
to
https://.mydomain.com/error-slug
.
I have never seen this on a Grav site. I suppose something is happening in Grav settings but a few hours on this did not help me find the culprit.
This site have just a few special plugins and disabling them do not help. All updated. I tried to look in the webmaster console and Grav Clockwork debugger and, as much as I understand those tools, I could not see information on this.
Any brilliant idea?
Thank you if you have a hint.