git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [users@httpd] RE: [EXTERNAL] Re: [users@httpd] Help Creating Test HTTP Server with SSL


On Tue, Dec 11, 2018 at 2:28 PM Kathy S Durlacher <ksdurlacher@xxxxxxx> 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... 10.90.231.6, 10.90.227.36, 10.90.231.36, ...
> Connecting to choiceportal-d|10.90.231.6|: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
work.
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: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx