私はこれを私の最後の行に持っています .htaccess
# Default response
RewriteRule ^.*$ https://miranda-zhang.github.io/cloud-computing-schema/v1.0/406.html [R=406,L]
しかし、テストしたところ、デフォルトのApacheサーバーページが返されるようです。
$ curl -H "Accept: anything else" http://150.203.213.249/test
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 336 100 336 0 0 336 0 0:00:01 --:--:-- 0:00:01 328k<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
<p>An appropriate representation of the requested resource /test could not be found on this server.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at 150.203.213.249 Port 80</address>
</body></html>
これは、w3id.orgへのエントリとして意図されています
ただし、コードを308に変更してリダイレクトすることはできますが、これは悪い習慣ですか、それとも問題ではありませんか?
ErrorDocument
ディレクティブを使用して、次の406
(またはの408
)カスタムページをレンダリングできます。
ErrorDocument 406 /error.html
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加