3

htaccess テクニックを使用していくつかの IP アドレスをブロックしています。これは、代わりに Fedora Core テスト ページが表示されるサイト/ドキュメント ルートを除くすべてのページでうまく機能します。

ルート ディレクトリにドキュメントが見つからない場合にテスト ページが表示されることを認識しているため、複数のドキュメントを作成し、ディレクトリ インデックスを設定しました。index.php は通常のドキュメント ルート ファイルです。

NB /etc/httpd/conf.d/welcome.conf へのアクセス権がありません

以下は、関連する htaccess コードです。

DirectoryIndex index.php index.html 403.php

ErrorDocument 403 /403.php

order allow,deny
deny from 5.39.218
deny from 146.0.74
deny from 5.39.219
deny from 176.102.38
allow from all

<FilesMatch "(403.php|hero.jpg|index.html)$">
 order allow,deny
 allow from all
</FilesMatch>

カスタム 403 ページを Web サイトのルートに表示する方法はありますか?

どんな提案でも大歓迎です。

4

3 に答える 3

2

このコードを試してください:

DirectoryIndex index.php index.html 403.php

ErrorDocument 403 /403.php

order allow,deny
allow from all
deny from 5.39.218
deny from 146.0.74
deny from 5.39.219
deny from 176.102.38
Satisfy    any

<FilesMatch "^(|403\.php|hero\.jpg)$">
 order allow,deny
 allow from all
</FilesMatch>
于 2013-11-17T04:45:54.430 に答える