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アップデートのVIA のRSS | メール Get updates via feedburner Get updates via twitter
Home / Apache & mod_rewrite / Coding / Apache & ModRewrite: How… ホーム / のApacheとmod_rewriteを / コーディング / Apacheの&ModRewrite:どのように...

Apache & ModRewrite: How to easily deny access to a folder with htaccess Apacheの&ModRewrite:どのように簡単にフォルダへのアクセスを拒否するhtaccessを

Posted on 17. 17日に掲載した。 Jul, 2009 by Dragos in Apache & mod_rewrite , Coding 7月、2009年のApacheドラゴシュ &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. 1つのソリューションいずれかの好奇の目に、外部干渉を避けるためにフォルダを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を使用すると便利であることが、Apacheの機能での作業。 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 ブログのコメントディスカスによって供給さ