hello experts, i need to limit the access to files or directory to some users, and i have no idea how i do this.
im working with linux..
i want that only php page will have the access to get files from directory and if someone will search the file url he will get no access, he will get 403 error..
example:
i have directory of messages, witch called messages.
i want to load file 4065. so i write on the url,
http://localhost/messages/4065.txt - and i'll get the result, the content that was inside the file..
i want to make sure that only when user login, the php file will be the only one whom can access the messages directory or to the files inside..
how do i do this?
how i block from everyone to access folder and only some php files have access..
lot's of thanks ahead.. :)
Once the user has logged in, grant an access cookie to the user, for example, named 'authorized'.
In .htaccess,
Open in new window
The last line of code will be working only when no authorized cookie is found.