Here is the scenario:
- There is a
index.php
file in root folder - some files are included in
index.php
which are in theincludes
folder. - 1 other file (
submit.php
) is in the root folder for form submit action.
I want to restrict direct user access to the files in includes
folder by htaccess. also for submit.php
. But include will work for index.php
file.
Like, if user types www.domain.com/includes/somepage.php
, it will restrict it (may be redirect to a error page).
This is pure
mod_rewrite
based solution:This will show forbidden error to use if URI contains either
/includes/
or/submit.php