htaccess redirect problem

santovito

Verified User
Joined
Nov 23, 2008
Messages
143
custom 404 error with fpm-php

Hi,

I would redirect the users to a specific page if an 404 error occurs.

I've insert in public_html an htaccess with this line: ErrorDocument 404 http://www.myurl.xx

but there is a problem: if a url with 404 code is a directory (http://mywebsite.xx/directory) work correctly, if the URL with 404 error is a page (http://mywebsite.xx/file.php) not work... the server return a blank page with "file not forund."

these are the characteristics of the server:
- centos 7 64 bit
- php 5.5 in FPM mode

in apache log file:
[Mon Oct 31 15:50:03.368412 2016] [proxy_fcgi:error] [pid 19512:tid 140729502365440] [client xx.xx.xx.xx:49490] AH01071: Got error 'Primary script unknown\n'


can i fix this problem?

Thank You in advance

Vito
 
Last edited:
Hi,

I still haven't solved the problem.

Searching the internet I found that the problem is what I thought: php-fpm.

the solution seems to be set "on fastcgi_intercept_errors;" but I think you have to have some active form because to me it seems not work.

Someone has already found a solution for this problem?

Thank You

Vito
 
Back
Top