My .htaccessErrorDocument 404 http://www.mywebsite.com/error_404.phpMy error_404.php header<?php header(HTTP/1.1 404 Not Found);?>Redirection works well but it seems like this configuration is not accepted by Google, This is a random page   Google Webmaster FetchHTTP/1.1 302 FoundDate: Sun, 13 Dec 2015 11:19:57 GMTServer: ApacheLocation: http://www.askcyan.com/error_404.phpContent-Length: 220Keep-Alive: timeout=5, max=100Connection: Keep-AliveContent-Type: text/html; charset=iso-8859-1<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN><html><head><title>302 Found</title></head><body><h1>Found</h1><p>The document has moved <a href=http://www.mywebsite.com/error_404.php>here</a>.</p></body></html>
How to properly make a custom 404 page in apache2
seo;html;php
You want:ErrorDocument 404 /error_404.phpDon't put the absolute URL in there - that's what's causing the redirect. Also, you don't need to set the 404 header through PHP - Apache will do that for you.