Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

SSL? Problem #7

Closed
eryk172 opened this issue May 10, 2019 · 4 comments
Closed

SSL? Problem #7

eryk172 opened this issue May 10, 2019 · 4 comments

Comments

@eryk172
Copy link

eryk172 commented May 10, 2019

Witam,
Po aktualizacji sklepu SMS (web) oraz dodaniu certyfikatu SSL wyskakuje taki problem
image

@TheDoctor0
Copy link
Owner

Dodałeś sobie wymuszenie przekierowania z http na https?

@eryk172
Copy link
Author

eryk172 commented May 10, 2019

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Disable HTTPS For Servers Script...
    RewriteCond %{HTTPS} on
    RewriteCond %{REQUEST_URI} ^/servers_stuff\.php$ [NC]
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Tak wygląda .htacces
wszystko okej?

@TheDoctor0
Copy link
Owner

Nope 😄 Moduł socket wykorzystywany przez plugin może działać tylko po protokole HTTP,
a tutaj dodałeś już na samym początku przekierowanie na HTTPS, co wywołuje problem.
Jeśli chcesz wymuszać strict-https musisz dodać wyjątek dla servers_stuff.php w rule:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Redirect To HTTPS Except For Servers Script...
    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} !^/servers_stuff.php$
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

@eryk172
Copy link
Author

eryk172 commented May 10, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants