Bug 64793 - url-encoded parameter not being set when certain regexp used for rewrite rule
Summary: url-encoded parameter not being set when certain regexp used for rewrite rule
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.5-HEAD
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL: rewrite regexp
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-07 16:40 UTC by temp.3
Modified: 2020-10-07 19:23 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description temp.3 2020-10-07 16:40:28 UTC
Apache Version 2.4.46
PHP 7.2 using FPM

The following rule/cond set looks for a path specification after the domain. if one exists, rewrite with "dir/" and the whole path string found: 

RewriteCond     %{HTTP_HOST}  "^(?:www\.)?mydomain\.com$"
RewriteCond     $1            "!^\/?$"
RewriteRule     ^(.*)$        /dir/$1     [L,NC]

However, the url path parsing / parameter passing function is not working consistently, functioning differently if a subdomain is present. 

For example, a php script, index.php uses param1 if set. If the initial url is the following:

https://www.mydomain.com/test/?param1=foo

param1 is passed properly, and the index.php script receives it in $_REQUEST

If url is:

https://mydomain.com/test/?param1=foo

The parameter is NOT passed to index.php.

As a side note: the following url encoded format DOES pass the paramter correctly when a subdomain is missing:

https://mydomain.com/test/?&param1=foo