PHP: How to redirect if any file path is accessed directly in .htaccess -


this path have secure details eg.,
http://localhost/application/secure_details

secure_details folder confidential files uploaded.
the third person knows above url can able particular details,
this not should allowed. need redirect error_page if person directly accessing particular url.

using mod_rewrite, add root .htaccess:

rewriteengine on rewritebase /  rewriterule ^application/secure_details/?.*?$ /error.html [l,r=301] 

additionally, add .htaccess file secure_details directory:

deny 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -