• Resolved meandron

    (@meandron)


    Hello all,

    after having moved my site from http to https, I suffer from a single but yet serious CSS redirection I cannot resolve on my own.

    Everything works fine except this call (css Stylesheet):
    https://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45

    Calling it (via wget), I get a 301 pointing to:
    https://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45

    So: https -> http – for whatever reason.
    Consequence: Mixed Content, CSS not loaded

    The stylesheet contains all my custom theme configuration (bulk pro), so the design is broken.

    Do you have any idea how to track down this issue? Or is there an easy workaround for this?

    Help would be highly appreciated – this issue drives me mad….

    Best,
    Matthias

    • This topic was modified 4 years, 10 months ago by meandron.
    • This topic was modified 4 years, 10 months ago by meandron.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • 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

    Thread Starter meandron

    (@meandron)

    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: https://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45[folge]
    --2020-01-16 01:59:29--  https://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 4 years, 10 months ago by meandron.
    • This reply was modified 4 years, 10 months ago by meandron.
    • This reply was modified 4 years, 10 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

    Thread Starter meandron

    (@meandron)

    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?

    Thread Starter meandron

    (@meandron)

    Too blind to see:
    A missing slash caused the problem – as answered above.

    Correct:
    https://www.cameratavocale.de/wordpress/?action=kirki-styles&ver=3.0.45

    Mine:
    https://www.cameratavocale.de/wordpress?action=kirki-styles&ver=3.0.45

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘redirection problem’ is closed to new replies.