0

.htaccess を使用して、/index.php ファイルと index.php ファイルのない URL を除くすべてのファイルを除外しようとしています。私は次のものを使用しています:

#.htaccess

#Look for php before html
DirectoryIndex index.php index.html

<Files *>
AuthType Basic
AuthName "Sorry, Restricted Files"
AuthUserFile  /home/Documents/SystemFiles/apache/passwords
Require user myuser
</Files>


<Files "index.php"> 
Order Deny,Allow 
Allow from All 
Satisfy any 
</Files>

現在、/index.php 以外はすべてパスワードで保護されています。ただし、私がやりたいのは、www.site.com/ と www.site.com/index.php の両方がパスワードで保護されないようにすることです。現在、www.site.com/ はパスワードで保護されていますが、www.site.com/index.php は保護されていません。

ありがとう

更新しました!!!!

私の問題を解決するこれを見つけました:

/index.php の代わりに / を要求するときに「認証が必要です」を取得する

4

0 に答える 0