1

I have this code:

$app->group('/api', function(\Slim\App $app) {
    $app->get('/user/{email}', \App\Server\Controller\UserController::class . ':get');
});

When I call this url: /api/user/name@domain.com, response is 404. the problem is in .com. Without this, response is 200 OK. How to add email address to url? thanks for advices

enter image description here

bluray
  • 1,875
  • 5
  • 36
  • 68
  • It should work. This feels like a security component/tool/program that's filtering out URLs to allegedly prevent remote code execution. – Álvaro González Dec 26 '18 at 12:47
  • Can be a problem in apache server? How to fix it? I updated my question. – bluray Dec 26 '18 at 12:50
  • The problem is that it can be a log of things: a firewall, an antivirus, [mod_security](https://www.modsecurity.org/), [suhosin](https://suhosin.org/stories/index.html)... You need to do some detective work. Are we talking about your local PC or it's an online hosting service? – Álvaro González Dec 26 '18 at 12:53
  • From the styling, you seem to be using PHP builtin server. That discards mod_security I guess :) – Álvaro González Dec 26 '18 at 12:55
  • Yes, this is my local PC. I dont know mod_security. Can you explain how it is a problem for my example? – bluray Dec 26 '18 at 13:00
  • 1
    A previous comments say, this is PHP's built in server. I tried your code using PHP's built in server and it resulted in a *Not Found* error, but when I used Apache, your code works as it should. And in your comment you're asking if it _can be a problem in Apache server_, which means you missed the fact that your're actually not using Apache at all! – Nima Dec 26 '18 at 13:06
  • 2
    Possible duplicate of [Slim framework - cannot interpret routes with dot](https://stackoverflow.com/questions/24336725/slim-framework-cannot-interpret-routes-with-dot) – Nima Dec 26 '18 at 13:09
  • 1
    Also this questions might be useful [Route with dot (IP address) not found, returns 404](https://stackoverflow.com/questions/44074051/route-with-dot-ip-address-not-found-returns-404) .the accepted answer links to a [bug report](https://bugs.php.net/bug.php?id=61286) related to your question. – Nima Dec 26 '18 at 13:25

0 Answers0