Zeka Posted September 2, 2017 Share Posted September 2, 2017 Hi! I have this code in my page template file: <?php namespace Processwire; if($input->urlSegment2) throw new Wire404Exception(); if ($input->urlSegment(1)) { $pagename = $input->urlSegment(1); $p = pages()->findOne("template=knowledge-base-category|knowledge-base-item, name={$pagename}"); if ($p->id) { $p->render(); } else { throw new Wire404Exception(); } } else { $viewData["categories"] = pages("template=knowledge-base-category"); region("content", renderView("knowledge-base", $viewData)); } ?> Max urlSegments is set to 4. Should URL segments end with trailing slash is set to Yes. Everything works as expected until I try to access any URL which ends with any special character like: site.com/current-page/real-page/not-real-page) or site.com/current-page/real-page/not-real-page@ In those cases, I get rendered homepage instead of 404 page. Is there something obvious that I missed? 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 2, 2017 Share Posted September 2, 2017 Hi, 3 hours ago, Zeka said: I get rendered homepage instead of 404 page. Me too! (ProcessWire 3.0.73) I guess it is a bug. What do you get when adding % (percent)? It seems to be a third case, that is why I'm asking. Link to comment Share on other sites More sharing options...
Zeka Posted September 2, 2017 Author Share Posted September 2, 2017 Hi @szabesz Thank you for confirmation. Yes, when adding % I got "Bad request! Your browser (or proxy) sent a request that this server could not understand." PW 3.0.74 Link to comment Share on other sites More sharing options...
szabesz Posted September 2, 2017 Share Posted September 2, 2017 1 minute ago, Zeka said: Yes, when adding % I got "Bad request! Your browser (or proxy) sent a request that this server could not understand." In my case the server hides the actual error message and only displays a false one. I did not dig further though. Link to comment Share on other sites More sharing options...
Zeka Posted September 2, 2017 Author Share Posted September 2, 2017 I have opened an issue for it. https://github.com/processwire/processwire-issues/issues/366 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now