We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

htaccess security problem

hi guys, I'm using htaccess on my project for some security reason, I tried to use

Deny from all

on my htaccess on public folder but the problem is it shows me the 403 forbidden page. I have also try to use

Options -Indexes +FollowSymLinks

but I still can access my files 1 by 1. what I want to do is to avoid direct access on my files using url.

Deny from all will disallow access to all resources unless valid credentials match a .htpasswd file. WHat exactly are you trying to do? WHat files need to be restricted? We need more information to help.

edited Aug '14

I want to restrict my css, images, js files not to be directly accessed using url like

myproject/public/css/style.css
myproject/public/js/style.js

is that posible to do it using htaccess?

It is possible but you then won't have any css, images or js on your site unless you create a controller that outputs these.

edited Aug '14

What do you mean controller that will output my css, js etc.? Can you please post some example so that I can have a idea on how can I do it?