picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.84k stars 614 forks source link

404 with empty first url parameter and rewrite_url #447

Closed nliautaud closed 6 years ago

nliautaud commented 6 years ago

Hi,

It seems that Pico 2 with rewrite_url return a 404 when a page is called with a first empty GET parameter.

/pico/page?foo # 404
/pico/page?foo=fine

Tested with a clean install, but not with different server configs.

Context : was testing the default ?output of Pico Output. You can see the issue at http://pico.nliautaud.fr/PicoOutput

PhrozenByte commented 6 years ago

This is known and documented behavior. See http://picocms.org/phpDoc/v2.0.0/classes/Pico.html#method_evaluateRequestUrl

QUERY_STRING always takes precedence over REQUEST_URI, because we can't possibly be sure that REQUEST_URI actually works (if REQUEST_URI is http://example.com/pico/, is this due to not working URL rewriting, or because the user actually requested the index page?). There are some more reasons (like not making old URLs invalid when enabling URL rewriting, or for simple debugging reasons).

How about ?output=default?

nliautaud commented 6 years ago

I see, thanks. Was using that as a shortcut feature, so that's not really important. Removed that.