2013-04-01 41 views
0

我認爲這將是一個簡單的任務,但無論是我worng或只是錯過了簡單的答案!強制Apache發送200而不是404.htaccess

我需要一種方法讓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 

回答

1

我會用RewriteEngine敘述重寫任何URL到不存在,做一個頁面的文件。

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

未經測試,但應該接近它。

相關問題