Log request string URL with # (number sign, hash, fragment) to apache/httpd custom access log?

2.2k views Asked by At

In a Virtual Host I use CustomLog and mod_log_config to log HTTP Requests:

LogFormat "\"%r\"" custom

The problem is that the entire Query String isn't being logged when there's a #(Number Sign) in the URL (Visiting domain.tld/slug/foo^bar#baz results in "GET /slug/foo%5ebar HTTP/1.1" in which #baz is omitted).

Is there any reason why a # character in the URL only gets logged until that point in the string? Is there documentation available on this or a way to work around this?

1

There are 1 answers

1
Malcolm Rowe On BEST ANSWER

The fragment part of the URL (the part after '#') is never sent to the server: it remains entirely client-side.