On 1/12/23 4:23 PM, rbo...@rcbowen.com wrote:
> On Thu, 2023-01-12 at 09:59 -0500, rbo...@rcbowen.com wrote:
>>
>> I'll dig deeper on this.
>>
>
> What I'm seeing is not making much sense to me.
>
> With:
>
> RewriteRule "^/games$" "/puzzles"
>
> I'm getting the following behavior:
>
>>>
> [Thu Jan 12 10:12:26.174426 2023] [rewrite:trace2] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] init rewrite
> engine with requested uri /games
> [Thu Jan 12 10:12:26.174523 2023] [rewrite:trace3] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] applying pattern
> '^/games$' to uri '/games'
> [Thu Jan 12 10:12:26.174575 2023] [rewrite:trace2] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] rewrite '/games'
> -> '/puzzles'
> [Thu Jan 12 10:12:26.174606 2023] [rewrite:trace2] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] local path
> result: /puzzles
> [Thu Jan 12 10:12:26.174645 2023] [rewrite:trace2] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] prefixed with
> document_root to /home/rbowen/devel/presentations/puzzles
> [Thu Jan 12 10:12:26.174673 2023] [rewrite:trace1] [pid 615418:tid
> 615494] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04004c30/initial] go-ahead with
> /home/rbowen/devel/presentations/puzzles [OK]
>
> [Thu Jan 12 10:12:26.175644 2023] [rewrite:trace2] [pid 615418:tid
> 615497] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04002c20/initial] init rewrite
> engine with requested uri /games/
> [Thu Jan 12 10:12:26.175725 2023] [rewrite:trace3] [pid 615418:tid
> 615497] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04002c20/initial] applying pattern
> '^/games$' to uri '/games/'
> [Thu Jan 12 10:12:26.175768 2023] [rewrite:trace1] [pid 615418:tid
> 615497] mod_rewrite.c(486): [client ::1:44536] ::1 - -
> [localhost/sid#564e6de96770][rid#7efe04002c20/initial] pass through
> /games/
> <<
>
> Line break added for clarity. That's where things get confusing.
>
> This is with wget, so any "browser geting smart" behavior hopefully
> removed.
>
> $ wget http://localhost/games
/home/rbowen/devel/presentations/puzzles is a directory, correct?
If yes, you get a redirect by mod_dir
Try making puzzles a file.
>
> It looks like it works as intended, but then for some reason, a
> separate second request is initiated, with the trailing slash added. I
> am not sure why that's happening.
>
> But with curl:
>
> $ curl http://localhost/games
>
> I get the desired/expected:
Add '-L' to your curl command and the behavior will be the same as with wget.
curl does not follow redirects by default wget does.
Regards
RĂ¼diger