You should add the following code to the .htaccess file to redirect all the http request to the https.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Take a look to the original thread to know where to put this code in .htaccess file.
https://wphuntrz.com/d/17-how-to-redirect-all-links-from-http-to-https
Thank you very much for your answer, but I think the problem is more complicated:
The call is done via https, say:
https://www.cameratavocale.de/wordpress?action=kirki-styles&ver=3.0.45
and then gets redirected to http – for whatever reason.
Sorry it’s in German, but I hope the trace will help:
--2020-01-16 01:59:29-- https://www.cameratavocale.de/wordpress?action=kirki-styles&ver=3.0.45
Wiederverwendung der bestehenden Verbindung zu www.cameratavocale.de:443.
HTTP Anforderung gesendet, warte auf Antwort... 301 Moved Permanently
Platz: http://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45[folge]
--2020-01-16 01:59:29-- http://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45
Verbindungsaufbau zu www.cameratavocale.de|94.130.216.214|:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: nicht spezifiziert [text/css]
In »www.cameratavocale.de/wordpress/index.html@action=kirki-styles&ver=3.0.45« speichern.
All other https (resource) calls are resolved fine via https, i.e. return 200 without any redirection.
My htaccess is as (I’m behind a proxy):
# BEGIN WordPress
# Die Anweisungen (Zeilen) zwischen <code>BEGIN WordPress</code> und <code>END WordPress</code> sind
# dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
# Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
-
This reply was modified 6 years, 2 months ago by
meandron.
-
This reply was modified 6 years, 2 months ago by
meandron.
-
This reply was modified 6 years, 2 months ago by
Jan Dembowski.
Into wordpress folder, fix RewriteBase and %{REQUEST_URI}.
# BEGIN WordPress
# Die Anweisungen (Zeilen) zwischen <code>BEGIN WordPress</code> und <code>END WordPress</code> sind
# dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
# Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# force folder, use RewriteRule . /wordpress/index.php
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
Good url:
https://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45
Bad url (i’m folder , please the end slash for wordpress directory):
https://www.cameratavocale.de/wordpress?action=kirki-styles&ver=3.0.45
SSH with certificate (wget): https://www.gnu.org/software/wget/manual/html_node/HTTPS-_0028SSL_002fTLS_0029-Options.html
The issue is not the HTTPS redirect I guess but the 301 status code the HTTPS call is resolving to, say to http.
How can I track down what is going on, i.e. why this 301 response code is even created?