php - How to protect ASSETS FOLDER in codeigniter -
i wanna protect assets folder in client side. of files can access public. wanna protect it. have rules .htaccess
below, wrong rules there?
rewriteengine on rewritecond $1 !^(index\.php|assets|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l,qsa]
you can 2 things
- via
.htaccess
(not tested) - via
index.html
1. .htaccess
add .htaccess
inside assets folder
<ifmodule authz_core_module> require denied </ifmodule> <ifmodule !authz_core_module> deny </ifmodule>
2. index.html
create index.html
file inside directory , add this
<!doctype html> <html> <head> <title>403 forbidden</title> </head> <body> <p>directory access forbidden.</p> </body> </html>
output
when 1 access outside on browser
directory access forbidden.
Comments
Post a Comment