How to hide this directory from being accessed?

How to hide this directory from being accessed?

Create a file called index.html and it’ll show that page instead. If you really want to prevent all the files in it from being accessed you can put them in the .data directory

1 Like

right now their location is /pages/about.html. you mean I should add .data/pages/about.html?
How would I add a hyperlink?

If you do that it won’t be accessible from your project domain.

if i put them inside .data. that means they are not accessible from the browser right?

what i want to do is if the user accidentally typed just it should return an error instead of showing all the files in the pages folder.

is there any way to do this?

In that case the index.html method works, you can put the not found content in the file and it’ll show that page

I suppose everything with a dot a the beginning would say Forbidden like .env.

Anyways, what you want to do is create a new file named pages/index.html.

And you have some HTML to replace it with. Try redirecting it to the home using it.