httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: [users@httpd] RE: [EXTERNAL] Re: [users@httpd] Help Creating Test HTTP Server with SSL
Date Tue, 11 Dec 2018 19:37:32 GMT
On Tue, Dec 11, 2018 at 2:28 PM Kathy S Durlacher <> wrote:
> Wget downloaded and executed, and I'm receiving the following which looks to point to
a possible problem with the recode of the uri to get to test SSL port 444:
> wget -r http://choiceportal-d:8084
> SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
> syswgetrc = c:/progra~1/wget/etc/wgetrc
> --2018-12-11 14:15:52--  http://choiceportal-d:8084/
> Resolving choiceportal-d...,,, ...
> Connecting to choiceportal-d||:8084... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: https://choiceportal-d:8084%:444{REQUEST_URI} [following]
> https://choiceportal-d:8084%:444{REQUEST_URI}: Bad port number.

>     RewriteRule (.*) https://%{HTTP_HOST}%:444{REQUEST_URI}

The % should be after the :444.

But more importantly, %{HTTP_HOST} will already contain the port if a
non-standard port was used for HTTP.  So tacking on :444 will not
Here is one recipe to isolate the host and port and use the host in
the redirect:

    RewriteEngine On
    RewriteCond %{HTTP_HOST}  (.*?)(:\d+)?$
    RewriteRule ^/(.*) https://%1:444/$1

%1 refers to the capture in the preceding condition.  The other change
to the RewriteRule is personal preference of having the / be outside
the capture and explicit in the substitution for readability.

    RewriteCond %{HTTP_HOST}  (.*):?\d*)
    RewriteRule (.*) https://%1:444{REQUEST_URI}

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message