How to configure a route in my application to serve a file to be puclic?

Hi everyone! I’m new to Kirby and I am not really familiar with backend development. I’ve created a small portfolio website to practice Kirby and I really like it. I use Heroku for hosting and I’m trying to add an ssl certificate through “let’s encrypt”.

During the process I was asked to add a folder “.well-known” and make it available in the server. How can I do that? no matter where I locate this folder I can’t reach it, I get a message that access is forbidden :frowning:

I saw there is a plugin that helps with these kind of files but I can’t understand how I set it right.

I would appreciate any help
Thanks in advance

A folder called .well-known should actually be accessible if you are using the default .htaccess file provided by the Kirby Starterkit which contains these lines:

# block files and folders beginning with a dot, such as .git
# except for the .well-known folder, which is used for Let's Encrypt and security.txt
RewriteRule (^|/)\.(?!well-known\/) index.php [L]

Thank you so much for the reply :slight_smile:

I can see that now in the .htaccess file - it is set as you mentioned.

but I’m not sure I understand what I should do now. I tried to create a folder ‘.well-known’ and place it in the ‘site’ folder but I couldn’t reach it in the server. it says I dont have permission.

Any idea?
(A reminder: I’m a total beginner in backend / php environment)

Thank you!

This folder should be in your project’s root folder, i.e. next to the /kirby, /site etc. folders, not inside the /site folder, because the /site folder is not accessble.

Thanks again for the reply
It’s still not working.

This is the instructions from Let’s Encrypt:

Create a file containing just this data:

UmBLOpO0XQ_S6ezfktzO-AGxmr_x2eRNeoESKTceTlE.gbl–gSfk-zYO9k7H-zmcYTJZkM0dDkYYTKVR-2wnIs

And make it available on your web server at this URL:

http://nirshaked.com/.well-known/acme-challenge/UmBLOpO0XQ_S6ezfktzO-AGxmr_x2eRNeoESKTceTlE

So this is what I did:
1 - I created a folder called ‘.well-known’ in the root folder (as you suggested).
2 - I created a folder called ‘acme-challenge’ inside ‘.well-known’.
3 - I created a file and named it ‘UmBLOpO0XQ_S6ezfktzO-AGxmr_x2eRNeoESKTceTlE’
4 - pushed changed to server.

and when I try to reach ‘http://nirshaked.com/.well-known’ I still get a 403 Forbidden error :frowning:

Any idea? :pray:

It might be a permission issue, however, since you are hosting on Heroku, why you didn’t follow their guide to set up ssl with ACM or what is your process here?

Thanks for the replies

I used the Heroku’s ACM but my website kept showing ‘not secure’ sign so I thought I need to create the ‘Let’s Encrypt’ SSL by myself and provide it to them.

The issue was solved after talking to the domain provider - apparently there was a problem in their side :sweat_smile:

Thank you for your help !