.htaccess を使用して 403 をリダイレクトしたいのですが、うまくいきません。
Options +FollowSymlinks
RewriteEngine on
ErrorDocument 403 notfound.html
RewriteRule notfound.html
すべての助けに感謝します。
ありがとうジャン
.htaccess を使用して 403 をリダイレクトしたいのですが、うまくいきません。
Options +FollowSymlinks
RewriteEngine on
ErrorDocument 403 notfound.html
RewriteRule notfound.html
すべての助けに感謝します。
ありがとうジャン
ErrorDocument ディレクティブの URL 部分は、DocumentRoot からの相対パスを示す先頭のスラッシュで始まるか、完全な URL である必要があります (外部ドキュメントを使用する場合)。
ここでは、RewriteEngine および RewriteRule ディレクティブはまったく必要ありません。
したがって、notfound.html がサイトのルート レベルにあると仮定すると、ディレクティブは次のようになります。
ErrorDocument 403 /notfound.html
これを行うための非常に簡単な方法を次に示します。
この行を使用
Options -Indexes
ErrorDocument 403 /goaway.html
goaway.htmlの head セクションに次の行が含まれています。
<meta HTTP-EQUIV="REFRESH" content="0; url=HERE YOU PUT THE URL YOU ARE REDIRECTING TO" />
それだけです...各403エラーはルートディレクトリのgoaway.htmlファイルに送られ、 goaway.htmlはそれらを選択したURLにリダイレクトします
RewriteEngine On
ErrorDocument 403 http://www.yourdomain.example/