From users-return-117618-archive-asf-public=cust-asf.ponee.io@httpd.apache.org Mon Jul 9 15:49:38 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4268A18062A for ; Mon, 9 Jul 2018 15:49:38 +0200 (CEST) Received: (qmail 70810 invoked by uid 500); 9 Jul 2018 13:49:36 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 70800 invoked by uid 99); 9 Jul 2018 13:49:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2018 13:49:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4E3561807B4 for ; Mon, 9 Jul 2018 13:49:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.982 X-Spam-Level: *** X-Spam-Status: No, score=3.982 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_10_20=1.162, KAM_COUK=0.85, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=aplpackaging-co-uk.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9rRzX3pd0hDn for ; Mon, 9 Jul 2018 13:49:35 +0000 (UTC) Received: from mail-ua0-f179.google.com (mail-ua0-f179.google.com [209.85.217.179]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 2A0895F1E2 for ; Mon, 9 Jul 2018 13:49:35 +0000 (UTC) Received: by mail-ua0-f179.google.com with SMTP id r18-v6so11722096ual.13 for ; Mon, 09 Jul 2018 06:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aplpackaging-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=qahYcBTj1XbrlDORMzpTMqLphz6j1L9y3vvoxOQxzmw=; b=Bldfbb5GON0Ml9VjBI3VPevwTA1ckHaDDgMvA+v3ljqfguUwhc4hY8B8OX1aHpLBDP wLsyJ34D8ffmX2CeTUStsn3nMZEKLUPk76Y0KGUiR6z+5E7fEMVLBBiX+uBD0NUOuiD4 /SHPXPpbMPN4DMcjVx6RM+Y6MDEk8Z05+cFvlQcMB9TnWTkyeJtylNXMfZvyCH5k4dor 3CYQltLqSqeTpt8/QeWzYhDg3jS49JzFPK0N0bhMAZilQ8ZTQuGK3f8v0s84HrXYEfFU t5v+GRerkwVI1X8aO9V6pHskHzTPEOYGSvQWNRxoD46Ob7+69KhRI7ml1Q2upLdg6A0i OHwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qahYcBTj1XbrlDORMzpTMqLphz6j1L9y3vvoxOQxzmw=; b=POiPJ43F1aZg02KY5oUeE+Zud5jF1uiSmBVqZ8ALjpJihsXgWIiOGXDvILrc91M6LT C5wRyKKd0pnowKW6ohgKRpIMg5DTJV4Rr0X7y13ZB9J94QZ0Ab9tq6bhAdEH3TlLEEpz CpkbKyG+KG++muEJGcBVRxyUB/csUZjc00Gt+AlccHYyHDFb/ZBb7apbIJmyVK+0FEhw 0A/9ylUvpWA5xcRtI9bI/82hRNO4+k0HunSf5axYEfbwPMOHVKEJrVfxm3hXYkiqDDS3 g/2swD4OVNiP+LtHOvDB5Sa5pIugtZfdEVFOE1m9dWP1wbm5x6hm58AVwQV1vJ1sqlFT pVfA== X-Gm-Message-State: APt69E1Spfm1ELFB8eS/wPesU6DWjdAfKgk3NW0vxaJN7QpzxvehR+FG lCHkphpsaBnfuJjf6m8lVWy71og/wcEXbRaAZlLQrVIf X-Google-Smtp-Source: AAOMgpc/YuM4fGI0K3qu70i4J9/IfoCsucu+wGYlFJHVqbIk/ed39sBvjk7s6i80p78TdEt3xVEj9M/2iYZjbMhJ9U0= X-Received: by 2002:ab0:605a:: with SMTP id o26-v6mr7341122ual.30.1531144174439; Mon, 09 Jul 2018 06:49:34 -0700 (PDT) MIME-Version: 1.0 From: David Wakelin Date: Mon, 9 Jul 2018 14:49:23 +0100 Message-ID: To: users@httpd.apache.org Content-Type: multipart/alternative; boundary="0000000000009e25440570914888" Subject: [users@httpd] Can I return a 404 for a file that is also the ErrorDocument? --0000000000009e25440570914888 Content-Type: text/plain; charset="UTF-8" I have created a file 404.html to act as my 404 page that is returned by ErrorDocument: ErrorDocument 404 /404.html This works fine, except when accessing 404.html directly, which returns a status code of 200 I've attempted a RewriteRule like so: ErrorDocument 404 /404.html RewriteRule "404\.html" - [R=404] However, this now returns an error instead of my 404.html doc: The requested URL /does-not-exist.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. How can I return a status of 404 for the 404.html document itself? I have seen solutions using PHP, but I am *NOT* using PHP and have no means to do so (I don't use mpm_prefork and I will not setup and run php-fpm just for a status code header) Kind Regards David Wakelin www.aplpackaging.co.uk david@aplpackaging.co.uk 01903 202 333 --0000000000009e25440570914888 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I have= created a file=C2=A0404.html= =C2=A0to act as my 404 page that is returned by=C2=A0ErrorDocument:

ErrorDocument 404 /404.html

This works fine= , except when accessing=C2=A0404.html= =C2=A0directly, which returns a status code of=C2=A0200

I've attempted a RewriteRule like so:

ErrorDocument 404 /=
404.html
RewriteRule "404\.html" - [R=3D404]

However, this n= ow returns an error instead of my=C2=A0404.h= tml=C2=A0doc:

The requested URL /does-not-exist.=
html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an =
ErrorDocument to handle the request.

How can I retur= n a status of=C2=A0404=C2=A0for the=C2=A0404.html=C2=A0= document itself?

I= have seen solutions using PHP, but I am=C2=A0NOT<= span>=C2=A0using PHP and have no means to do so (I don't use mpm= _prefork and I will not setup and run php-fpm just for a status code header= )

Kind Regards

David = Wakelin



www.aplpackaging.co.uk=C2=A0 =C2=A0david@aplpac= kaging.co.uk=C2=A0=C2=A0 01903 = 202 333
--0000000000009e25440570914888--