Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

287
Vistas
PHP friendly URL bug?

I just started a course of implementing MVC pattern using PHP and I think I'm experiencing a bug regarding friendly URL engine. The site I'm creating has the follow URL syntax: http://[site]/[controller]/[method]/[parameters] .

Until now it works in a very simple way: I access a controller and is printed on screen which controller is beeing accessed (printed by a method from controller's class). The problem is that when I access the URL http://cursophp/cliente (a real controller) it works and when I try an inexistent controller WAMP shows an error screen that informs that the page couldn't be found; but, when I try to access http://cursophp/produto (also a real controller), an 404 error from Apache is exhibited! And I also tried with other words like: produto1, produto2, product, product1 ("prod" prefix) and the same 404 error is exhibited!

Using Composer or including directly the controller file with "require" results in the same problem.

Is it a known bug or am I making a mistake?

htacess content:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !f
RewriteCond %{REQUEST_FILENAME} !d
RewriteRule ^(.*)$ index.php/$1 [L]

Just adding more details:

When I try "pro" as controller's name: enter image description here

When I try "prod" (or any word with "prod" prefix): enter image description here

When I try "aaaa" (or any word, of any length, that doesn't correspond to a controller's name): enter image description here

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

The problem is probably in function that checking the route. Try to debug on which line it's starting show the error. However, it's impossible to suggest you a specific way of solving this problem without providing more details

over 4 years ago · Santiago Trujillo Denunciar

0

This PHP script is crappy, because it does not handle unknown controllers properly.

Instead it should respond with HTTP404, when the file to load cannot be located.

Generally speaking, you'd need to fix that in file Core.php.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda