Apache & ModRewrite: How to easily deny access to a folder with htaccess Apache & ModRewrite: Si të lehtë të refuzojë qasje në një dosje me htaccess
Posted on 17. Dërguar të 17. Jul, 2009 by Dragos in Apache & mod_rewrite , Coding Korrik, 2009 nga Dragos në Apache & mod_rewrite, shifrim
Working on a project right now I was looking for a solution to protect a folder containing template php files (includes in larger files). Duke punuar në një projekt tani isha duke kërkuar për një zgjidhje për të mbrojtur një dosje që përmban fotografi php template (përfshin në dosjet më të mëdha). One solution would be to chmod the folder to avoid external meddling of one's curious eyes. Një zgjidhje do të ishte të chmod dosje për të shmangur ndërhyrja e jashtme e sytë e kureshtar. But working with Apache's features I found out that it is more convenient to use the mod_rewrite feature to deny access to a folder and its content. Por pune e Apache me tiparet e kuptova se ai është më i përshtatshëm për të përdorur mod_rewrite funksion të refuzojë qasje në një dosje dhe përmbajtjen e saj. Here's the solution. Ja zgjidhje. In my case the folder I was trying to protect was templates so my code looked as following (simplified): Në rastin tim dosje isha duke u përpjekur për të mbrojtur të ishte templates aq kodin tim dukej si vijon (simplified):
Options +FollowSymLinks
RewriteEngine on
#replace the word templates with the name of your own folder
RewriteRule ^/?templates/?(.*)?$ - [F,L]
Related posts: Related posts:












































