Does redirecting prevent users from accessing files in the root?

Viewed 22

Hey everyone I'm publishing my website and I want to make it as secures as i can. I have researched if storing API keys and database credentials in php is safe. I read about the suggestion of storing them for example in a .env file outside of the root. I was checking my webhosting but I don't have the option of posting them outside the root. The website now redirects to a folder with all the files and i stored the .env outside of it.

Is the .env file still accessible by users in the public after redirecting?

I would love to get an answer or suggestions on how to solve this problem.

0 Answers
Related