0

我认为这将是一项简单的任务,但要么我很累,要么只是错过了简单的答案!

我需要一种让 Apache 为任何页面(包括 404 页面)返回 200 的方法。有什么简单的解决办法吗?

这是当前的标头响应:

HTTP/1.1 
404 Article not found 
Date: Mon, 01 Apr 2013 18:05:38 GMT 
Server: Apache P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" 
Cache-Control: no-cache 
Pragma: no-cache 
Set-Cookie: 440d08f3c65b7f89402db924f5428cbd=ujg53v71nc68fi5pc36rllnd707; path=/ 
Set-Cookie: trcusr=%24%24; expires=Tue, 19-Jan-2038 03:14:07 GMT; path=/ 
Set-Cookie: cltid=103; expires=Tue, 19-Jan-2038 03:14:07 GMT; path=/ 
Set-Cookie: js_vsid=355; expires=Mon, 01-Apr-2013 22:05:38 GMT; path=/ 
Content-Type: text/html; charset=utf-8
4

1 回答 1

1

我会使用 RewriteEngine 将任何 URL 重写为不存在的文件的文件。

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ file-that-exists.html

未经测试,但应该接近它。

于 2013-04-03T17:26:40.950 回答