I don't want the apache of a website return any HTTP code 404,
the reason is that the accreditation council will scan all the website,
many javascript links and some incidents will cause the 404 code,
in fact, those links are valid but that checker will misjudge error.
So, i want to prevent the apache to return HTTP code 404,
How can I configure apache return HTTP cods 200 instead of 404 and show my define error page?
相关问题
- Angular RxJS mergeMap types
- Stop .htaccess redirect with query string
- Google Apps Script: testing doPost() with cURL
- How to instantiate Http service in main.ts manuall
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
相关文章
- C#使用http访问网络,有办法用指定网卡访问网络嘛?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- send redirect and setting cookie, using laravel 5
- Is a unicode user agent legal inside an HTTP heade
- How reliable is HTTP_HOST?
- git: retry if http request failed
- Making a two way SSL authentication between apache
- Flutter - http.get fails on macos build target: Co
I use this:
This code has to be put at the top of the .php file in the first line of code. Search engines, crawlers, browsers and anyone accessing the site will see the errordocument 404 page as a header 200.
Header 200 means the page exists. Google will crawl and index sites with header status 200.
From: http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Add this to your .htaccess file:
That will change the Apache ErrorDocument to the /404 file. But the Redirect line causes requests for /404 to issue a 200 OK response instead of a 404.
If that doesn't work it is due to rewrites no doubt. So if that's the case add this under those first 2 lines but above any other rewrite lines in your .htaccess file:
Explained in more detail at: http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#Automate_ErrorDocument_Triggering
i think you can use this below simply code into PHP:
header("HTTP/1.1 200 OK");
you can test it.