Skip to content

Can't retrieve certificate when forcing SSL with .htaccess #46

@ghost

Description

Greetings again :)

First of all my apologies for my bad English.

On topic:
When i'm trying to install Let's Encrypt based certificates on for example a HTML site. It does work without .htaccess redirects to https, but if they exist, the challenge cannot be completed.

I'm not sure if thats normal or not. I'm wondering how auto renewal will behave with this seems to be issue.

I've found a work around for the .htaccess, where te REMOTE_ADDR is the main IP of your server:

Force SSL

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REMOTE_ADDR} !^123.123.123.123$
RewriteRule ^.$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{REMOTE_ADDR} !^123.123.123.123$
RewriteRule .
https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions