Allowing to access files in hidden directories on

2020-03-26 03:09发布

I want to create SSL certificate for my domain via the webroot directory ".well-known/acme-challenge" for verification. I'm using shared hosting and I don't have access to apache configuration files, so I can only use .htaccess file.

Problem is that I can't access files in this folder from browser using address "my.domain/.well-known/acme-challenge/filename". I'm just getting 404 error, even though I have these files in this directory.

So I want to know, if there's any rule, which I could use in .htaccess file to gain access to hidden directories from browser. If you need more informations let me know.

1条回答
Evening l夕情丶
2楼-- · 2020-03-26 04:08

Assuming your host allows overrides, this may work:

    <IfModule mod_rewrite.c> 
        RewriteCond %{REQUEST_FILENAME} !.well-known/
        RewriteRule "(^|/)\.(?!well-known)" - [F]
    </IfModule>
查看更多
登录 后发表回答