I have a site with only static HTML pages and a Apache .htaccess file. I have a custom 404 error page to redirect using the following Apache directive
The custom HTML page is served by nginx, and returns a wrong HTTP Status Code. It returns Is there any way to return the right Status Code using .htaccess or HTML? or any workaround, without using javascript or php? asked 20 Jun '11, 11:07 joe di castro |
Solved, the problem was mine. I was using an absolute ULR instead of a relative in the .htacces directive. Sorry for the wasted time. answered 20 Jun '11, 11:24 joe di castro |
nginx should just be forwarding the status code returned from Apache; nginx doesn't modify outgoing responses at all.
Could you show us an example URL where this is happening?
Sure,
An inexistent page: http://joedicastro.com/noexists.html
Custom error page: http://joedicastro.com/notfound.html
Using
We have:
Both of those are working correctly for me with curl and wget:
Are you sure you're hitting the right URLs?
You're right. The problem is solved now.
I had a wrong Apache directive (a lapse, maybe)
instead the correct