You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Carsten Wiedmann <ca...@gmx.de> on 2009/12/01 10:49:11 UTC

[users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

William A. Rowe Jr. schrieb:
>     RewriteRule .* - [R=400]

Hm, ok, I've never realized, that I can set other status codes in
RewriteRule [R], then the well known redirect status codes (Redirection
3xx). A little bit curious?

With [R=400] it's the same as with the Perl script (thanks for this hint).

Another thing:
I know [F] also exists, but if all status codes are valid (like I can read
in the manual), [R=404] is not working correctly.

Well, and the error document with [R=400] (or other status codes) is also
not multi language.

Regards,
Carsten


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

Posted by Carsten Wiedmann <ca...@gmx.de>.
Carsten Wiedmann schrieb:
> It's the same as with:
> | RewriteRule ^.*$ - [R=400]
> 
> BTW:
> If "httpd-multilang-errordoc.conf" is enabled, all above solutions are also
> not working nice. Because now the error document shows:

Just for the records. This is doing the trick:
| NameVirtualHost *:80
|
| <VirtualHost *:80>
|     ServerName nonexistent
|
|     RewriteEngine On
|     RewriteCond %{IS_SUBREQ} false
|     RewriteCond %{REQUEST_URI} !/error/HTTP_BAD_REQUEST.html.var
|     RewriteRule ^.*$ - [R=400]
| </VirtualHost>


Regards,
Carsten


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

Posted by Pete Houston <ph...@openstrike.co.uk>.
On Mon, Jan 09, 2012 at 12:37:53PM +0000, jimmyhendrix wrote:
> I would like to change that status code on my httpd.conf  and set to the value
> 404 on the same page http://cmsboprd/page-indisponible/index.html?fmt=default

Have a read of this:

http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

particularly the paragraph referring to remote URLs and then look through
your configuration to find where you have introduced this behaviour so
you can fix it.

HTH,

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107

[users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

Posted by jimmyhendrix <nl...@yahoo.fr>.
Hi guys,

When requesting a non-existing page, like:

http://cmsboprd/notre-offre/services/pied-de-page/masque/index.html

I will get a non-available page 
http://cmsboprd/page-indisponible/index.html?fmt=default with a  status code 302.

I would like to change that status code on my httpd.conf  and set to the value
404 on the same page http://cmsboprd/page-indisponible/index.html?fmt=default

Please help me, It is almost one month that I looking for that solution.

Regards,

Jimmy






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

Posted by Carsten Wiedmann <ca...@gmx.de>.
William A. Rowe Jr. schrieb:
>> Well, and the error document with [R=400] (or other status codes) is also
>> not multi language.
> 
> Right; presume for a moment that anyone hitting your server with a bogus dns
> reference or by-ip is doing so in a less-than-friendly, spidery or malicious
> manner.  Are they really worth sending an elegant error page to?

OK, for script kiddies is must not be multi language (maybe just for
completeness).

It's more because of the common wildcard DNS. For an vhost I have deleted in
Apache, it might be also possible to set an status 410, but I guess 400 is
better (not only the current uri is gone, the whole host does not exist). Of
course, setting a 410 is the same "problem".


> I'm not certain if this works, but;
> 
> Redirect 400 /
> 
> or
> 
> RedirectMatch 400 .*

It's the same as with:
| RewriteRule ^.*$ - [R=400]

BTW:
If "httpd-multilang-errordoc.conf" is enabled, all above solutions are also
not working nice. Because now the error document shows:

| Bad Request
|
| Your browser sent a request that this server could not understand.
|
| Additionally, a 500 Internal Server Error error was encountered while
| trying to use an ErrorDocument to handle the request.

(and with [R=404] you have an additional error, because of  endless internal
redirects)

Regards,
Carsten


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Apache httpd does not respect the HTTP RFCs !

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Carsten Wiedmann wrote:
> 
> Well, and the error document with [R=400] (or other status codes) is also
> not multi language.

Right; presume for a moment that anyone hitting your server with a bogus dns
reference or by-ip is doing so in a less-than-friendly, spidery or malicious
manner.  Are they really worth sending an elegant error page to?

You can't both set the code and trigger ErrorDocument; but of course patches
would be welcome.

I'm not certain if this works, but;

Redirect 400 /

or

RedirectMatch 400 .*

would more likely provide the proper error page you are looking for, but
I haven't tested this for you.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org