You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2022/05/31 20:22:33 UTC

[Bug 66099] New: Error in the documentation for %{REQUEST_URI}

https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

            Bug ID: 66099
           Summary: Error in the documentation  for %{REQUEST_URI}
           Product: Apache httpd-2
           Version: 2.4-HEAD
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
          Assignee: bugs@httpd.apache.org
          Reporter: joerg.reinholz@fastix.org
  Target Milestone: ---

The Doc says:

„REQUEST_URI“
“The path component of the requested URI, such as "/index.html". This notably
excludes the query string which is available as its own variable named
QUERY_STRING.“

https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond

This not correct.

I have tried and the %{QUERY_STRING} is a part of %{REQUEST_URI} (not only in
rewrite-rules, in PHP $_SERVER['QUERY_STRING'] show the same.

Per Definitionem is the query a part of the uri (URI). so shold only the
documentation be corrected.

Discussion (in german):

https://forum.selfhtml.org/self/2022/may/30/weiterleitung-von-domain-zu-domain/1799519#m1799519

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #3 from Jörg Reinholz <jo...@fastix.org> ---
Created attachment 38308
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38308&action=edit
This show the redirect of the client-side.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #9 from Yann Ylavic <yl...@gmail.com> ---
(In reply to Jörg Reinholz from comment #8)
> the statement "This notably excludes the query string" conveys that the
> query is never part of '%{REQUEST_URI}'.

It's actually true that the query-string is never part of %{REQUEST_URI} in
mod_rewrite, the query string generated by your redirect rule comes from the
rule itself, not the content of the %{REQUEST_URI} variable.

Nevertheless, it probably should be included in the docs (though not relative
to %{REQUEST_URI}).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #5 from Jörg Reinholz <jo...@fastix.org> ---
on fastix.de i have only this in a .htaccess - File. This has the same effect:
The query (try fastix.org/test?foo=bar) is in the redirect-uri:


RewriteEngine On
RewriteRule (.*) https://www.fastix.org%{REQUEST_URI}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #8 from Jörg Reinholz <jo...@fastix.org> ---
> „The query-string is used because the target URI is a full URI“

I think this should also be noted in the documentation in this case. Because
the statement "This notably excludes the query string" conveys that the query
is never part of '%{REQUEST_URI}'.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Yann Ylavic <yl...@gmail.com> ---
Note added in r1901487.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Eric Covener <co...@gmail.com> ---
In my testing the query string is not part of the %{REQUEST_URI} variable
resolved by mod_rewrite (or expression-based use)

The REQUEST_URI environment variable passed to CGI and CGI-like handlers has a
different value, the one you'd expect based on the name (including the query)

If you think it really contradicts the doc in mod_rewrite in some config please
share the most basic config that demonstrates the issue and the resulting
rewrite:trace8 and access_log.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #2 from Jörg Reinholz <jo...@fastix.org> ---
Created attachment 38307
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38307&action=edit
error.log .filtered

The error.log shows explicit:

applying pattern '(.*)' to uri '/'
rewrite '/' -> 'https://home.fastix.org/'
explicitly forcing redirect with https://home.fastix.org/
escaping https://home.fastix.org/ for redirect
copying foo=bar to query string for redirect 
redirect to https://home.fastix.org/?foo=bar [REDIRECT/301]

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

Jörg Reinholz <jo...@fastix.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FAQ
                URL|                            |https://httpd.apache.org/do
                   |                            |cs/current/mod/mod_rewrite.
                   |                            |html#rewritecond

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #4 from Jörg Reinholz <jo...@fastix.org> ---
Created attachment 38309
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38309&action=edit
The config file for the apache

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #6 from Jörg Reinholz <jo...@fastix.org> ---
Sorry, there is an error in my descryption:

on fastix.de i have only this in a .htaccess - File. This has the same effect:
The query (try fastix.de/test?foo=bar) is in the redirect-uri:


RewriteEngine On
RewriteRule (.*) https://www.fastix.org%{REQUEST_URI}

--- 
chanched „try fastix.org/test?foo=bar“ to „try fastix.de/test?foo=bar“

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66099] Error in the documentation for %{REQUEST_URI}

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66099

--- Comment #7 from Yann Ylavic <yl...@gmail.com> ---
The query-string is used because the target URI is a full URI (starting with
"https:") and mod_rewrite preserves the query-string for full URIs.

If you want to avoid that, use the [QSD] flag (instead of [QSA]).

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org