This is a translated page. The original can be found here: http://iwebdevel.com/2009/07/17/apache-modrewrite-how-to-easily-deny-access-to-a-folder-with-htaccess/
UPDATES VIA RSS | Email 업데이 트를 통해 RSS | 이메일 Get updates via feedburner Get updates via twitter
Home / Apache & mod_rewrite / Coding / Apache & ModRewrite: How… / 아파치 & mod_rewrite / 코딩 / 아파치 & ModRewrite : 어떻게 ...

Apache & ModRewrite: How to easily deny access to a folder with htaccess 아파치 & ModRewrite : 어떻게 쉽게 폴더에 대한 액세스를 거부 htaccess를

Posted on 17. 17 게시됨. Jul, 2009 by Dragos in Apache & mod_rewrite , Coding 7월, 2009 아파치에서 드라 고스 & mod_rewrite, 코딩에 의해

Working on a project right now I was looking for a solution to protect a folder containing template php files (includes in larger files). 작업 프로젝트에 지금은 솔루션 폴더에 php 파일이 포함된 템플릿을 보호하기 위해 (큰 파일 포함)을 찾고있다. One solution would be to chmod the folder to avoid external meddling of one's curious eyes. 하나의 솔루션은 하나의 호기심이 눈을 외부의 간섭을 피하기 위해 폴더를 chmod를하는 것입니다. 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. 그러나 나는 그것이 더 많은 폴더와 그 내용에 대한 액세스를 거부하는 기능을 mod_rewrite를 사용하여 편리하게 알아 냈 아파치의 기능과 함께 작동. Here's the solution. 여기에서 솔루션의. In my case the folder I was trying to protect was templates so my code looked as following (simplified): 내 경우에는 내가 폴더를 보호하려고했다 템플릿을 정말 내 코드를 ()에 다음과 같은 단순 보였다 :


Options +FollowSymLinks
RewriteEngine on
#replace the word templates with the name of your own folder
RewriteRule ^/?templates/?(.*)?$ - [F,L]

Translate this post 번역이 게시물에


Related posts: 관련 게시물 :

  1. PHP: Get all files and folders from a directory (folder) PHP는 : 모든 파일 및 폴더를 디렉토리 (폴더)에서 떨어져

    blog comments powered by Disqus 블로그 덧글 Disqus에 의해 제공