我在.htaccess文件中使用以下代码,我收到服务器错误:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
这是我的.htaccess文件的内容:
ErrorDocument 100 /Drivemash/htaccessError/100.htm
ErrorDocument 101 /Drivemash/htaccessError/101.htm
ErrorDocument 102 /Drivemash/htaccessError/102.htm
ErrorDocument 200 /Drivemash/htaccessError/200.htm
ErrorDocument 201 /Drivemash/htaccessError/201.htm
ErrorDocument 202 /Drivemash/htaccessError/202.htm
ErrorDocument 203 /Drivemash/htaccessError/203.htm
ErrorDocument 204 /Drivemash/htaccessError/204.htm
ErrorDocument 205 /Drivemash/htaccessError/205.htm
ErrorDocument 206 /Drivemash/htaccessError/206.htm
ErrorDocument 207 /Drivemash/htaccessError/207.htm
ErrorDocument 300 /Drivemash/htaccessError/300.htm
ErrorDocument 301 /Drivemash/htaccessError/301.htm
ErrorDocument 302 /Drivemash/htaccessError/302.htm
ErrorDocument 303 /Drivemash/htaccessError/303.htm
ErrorDocument 304 /Drivemash/htaccessError/304.htm
ErrorDocument 305 /Drivemash/htaccessError/305.htm
ErrorDocument 306 /Drivemash/htaccessError/306.htm
ErrorDocument 307 /Drivemash/htaccessError/307.htm
ErrorDocument 400 /Drivemash/htaccessError/400.htm
ErrorDocument 401 /Drivemash/htaccessError/401.htm
ErrorDocument 402 /Drivemash/htaccessError/402.htm
ErrorDocument 403 /Drivemash/htaccessError/403.htm
ErrorDocument 404 /Drivemash/htaccessError/404.htm
ErrorDocument 405 /Drivemash/htaccessError/405.htm
ErrorDocument 406 /Drivemash/htaccessError/406.htm
ErrorDocument 407 /Drivemash/htaccessError/407.htm
ErrorDocument 408 /Drivemash/htaccessError/408.htm
ErrorDocument 409 /Drivemash/htaccessError/409.htm
ErrorDocument 410 /Drivemash/htaccessError/410.htm
ErrorDocument 411 /Drivemash/htaccessError/411.htm
ErrorDocument 412 /Drivemash/htaccessError/412.htm
ErrorDocument 413 /Drivemash/htaccessError/413.htm
ErrorDocument 414 /Drivemash/htaccessError/414.htm
ErrorDocument 415 /Drivemash/htaccessError/415.htm
ErrorDocument 416 /Drivemash/htaccessError/416.htm
ErrorDocument 417 /Drivemash/htaccessError/417.htm
ErrorDocument 418 /Drivemash/htaccessError/418.htm
ErrorDocument 419 /Drivemash/htaccessError/419.htm
ErrorDocument 420 /Drivemash/htaccessError/420.htm
ErrorDocument 421 /Drivemash/htaccessError/421.htm
ErrorDocument 422 /Drivemash/htaccessError/422.htm
ErrorDocument 423 /Drivemash/htaccessError/423.htm
ErrorDocument 424 /Drivemash/htaccessError/424.htm
ErrorDocument 425 /Drivemash/htaccessError/425.htm
ErrorDocument 426 /Drivemash/htaccessError/426.htm
ErrorDocument 500 /Drivemash/htaccessError/500.htm
ErrorDocument 501 /Drivemash/htaccessError/501.htm
ErrorDocument 502 /Drivemash/htaccessError/502.htm
ErrorDocument 503 /Drivemash/htaccessError/503.htm
ErrorDocument 504 /Drivemash/htaccessError/504.htm
ErrorDocument 505 /Drivemash/htaccessError/505.htm
ErrorDocument 506 /Drivemash/htaccessError/506.htm
ErrorDocument 507 /Drivemash/htaccessError/507.htm
ErrorDocument 508 /Drivemash/htaccessError/508.htm
ErrorDocument 509 /Drivemash/htaccessError/509.htm
ErrorDocument 510 /Drivemash/htaccessError/510.htm
error.log说明了这一点:
[Thu Dec 05 00:29:56.835254 2013] [core:alert] [pid 7480:tid 1716] [client 127.0.0.1:52561] C:/xampp/htdocs/Drivemash/.htaccess: Unsupported HTTP response code 306
我收到此错误的原因是什么?
答案 0 :(得分:0)
您需要更改每行的最后部分,如:
ErrorDocument 510 /Drivemash/htaccessError/404.htm
并将其更改为:
ErrorDocument 510 /Drivemash/htaccessError/510.htm
看看这个教程: http://www.angelfire.com/dc/html-webmaster/article12.htm