1
0 Comments

When you want to use SSL with htaccess on xserver

Access restrictions and redirect settings are set for the setting domain
Temporarily disable them until the update is completed.

Link: https://www.xserver.ne.jp/manual/man_server_ssl.php

It's troublesome to have to disable .htaccess every time you set up and update SSL. It's a workaround.

There is such access when setting SSL.

hoge.jp **.**.**.** - - [06/May/2022:10:19:17 +0900] "GET /.well-known/acme-challenge/Hoge123Fuga456hoge789Fuga HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" 

Therefore, you should exclude this access. example:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} !letsencrypt #これを追加
    RewriteRule ^(.*)$ public/$1 [QSA,L]
</IfModule>
on July 27, 2023