Summary: | Rewrite port is taken into hostname | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | Danila Galimov <bgrh> |
Component: | mod_rewrite | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | REOPENED --- | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 2.4.10 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Danila Galimov
2014-10-03 20:38:11 UTC
It also reproduces if i change it to RewriteRule ^/(.*) http://%{HTTP_HOST}:%{SERVER_PORT}/$1 [P] Unless I missed something, your configuration matches: > Here are all possible substitution combinations and their meanings: > > Inside per-server configuration (httpd.conf) > for request ``GET /somepath/pathinfo'': > [...] > ^/somepath(.*) http://thishost/otherpath$1 [P] doesn't make sense, not supported at the end of https://httpd.apache.org/docs/2.4/en/mod/mod_rewrite.html#rewriterule. I tried your configuration with the trunk version. I also get a AH00898, but with another error message. If I change the port number in the RewriteRule to something different from the one in the VirtualHost, everything seems to work fine. So, I guess that "*:8121" in VirtualHost and '%{HTTP_HOST}:8121' in RewriteRule are the same, which is not supported as per doc. So closing as invalid. Feel free to re-open, if I misunderstood something. Well, If if it not supported for now, is it possible to convert this into a feature request? It would be very handy to specify a port in case it is different from the virtual host configuration. If the port is different, it seems to work, according to my testing. Look at the allowed configuration at the bottom of the link in comment 2. My understanding of the doc, and according to my tests, is that "thishost" mentioned in the doc means "the host name including its port". So *:8121 in the VirtualHost and '%{HTTP_HOST}:8121' in RewriteRule matches, and is not a supported configuration. But *:8121 in the VirtualHost and '%{HTTP_HOST}:8122' in RewriteRule shouldn't match and would refer to : > ^localpath(.*) http://otherhost/otherpath$1 [P] http://otherhost/otherpath/pathinfo via internal proxy in the doc. If you could try and confirm, I would update the doc to be more precise. (and thx for your prompt feed-back on a 4 years old PR!) |