https www redirect and pretty-urls

Permalink
Does anyone have experience with the setup of c5.6 with https and redirect to www (and pretty urls) ? Added this http://legacy-documentation.concrete5.org/tutorials/force-https-for... and www redirect

I don't know if I'm experiencing a strange problem or I'm missing something.
All the http non-www domain urls are redirected to the correct https www domain urls.

But when I try to access https :// domain.com it's not redirected.

Update: the server certificate is only for the www domain and not for subdomains or * (wildcard). Probably the browser catches the request before htaccess is reached. (?)

Concrete5.6.3.2

gr c5dragon

.htaccess file
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect to www.
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) https://www.domain.com/$1 [R=301,L] 
# Force https.
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
# Pretty urls
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]


And in my site.php
############ BASE CONFIG ############
#####################################
define('BASE_URL', 'https://www.domain.com');
define('DIR_REL', '');

c5dragon
 
A3020 replied on at Permalink Reply
A3020
You're the owner of domain.com, lucky you :)

These are the rules I'm using, maybe it helps:
# Rewrite "http://wwww.example.com ->http://www.example.com"
# Rewrite "http://example.com ->http://example.com"
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
# Rewrite "https://example.com ->http://www.example.com"
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
c5dragon replied on at Permalink Reply
c5dragon
Update: the server certificate is only for the www domain and not for subdomains or * (wildcard). Probably the browser catches the request before htaccess is reached. (?)