Jump to content

sanjom

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by sanjom

  1. Hey, I've used ProcessWire for a while now but not made an appearance in the forum yet :D I just wanted to share the solution to a small problem I came across with Let's Encrypt (free SSL service).

    Let's Encrypt SSL certificates need to be renewed every few months to remain active. My web host does this automatically but needs access to a folder named ".well-known", which ProcessWire blocks by default because it starts with a dot. This results in a 403 error.

    To work around this, just add the following line to your .htaccess file, around line 150:

    RewriteCond %{REQUEST_URI} !^(/\.well-known)

    It should be the first condition in the section titled "Access Restrictions: Keep web users out of dirs that begin with a period".

    I also ran into another problem. Let's Encrypt accesses mail.example.com which is redirected to www.mail.example.com because I enabled the redirection in my .htaccess fie. So we need to exclude the mail sub domain from that rule using the following line as the second condition in the www-redirection section (around line 160):

    RewriteCond %{HTTP_HOST} !^mail\. [NC]

    I know it's quite a specific problem but maybe it'll help someone Googling the issue.

    I was curious, is there any way of redirecting to the www-version without having to exclude all your sub domains? The only way I can think of involves explicitly writing out your domain name in the .htaccess file and redirecting whenever the %{HTTP_HOST} starts with that name. But obviously that would lead to a loss of generality.

    • Like 5
×
×
  • Create New...