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

428
Vistas
PHP/Apache - Web server not respecting RewriteRule?

I have a site hosted on Hostinger and was experimenting with RewriteRule in .htaccess, and here's what I ended up using:

RewriteEngine on
RewriteRule ^/(accounts)/[0-9]+[/]?$ /account?$2

I was hoping that this would redirect /accounts/[id] to /account?[id] but instead I get a 404. Any thoughts?

EDIT: I also did not mention that this is on a subdomain. Should htaccess be on the www document root and not the subdomain document root? Would be weird

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

0

You are only capturing only one group, and pasting $2, therefore this wont work... instead you should do:

RewriteRule ^(accounts)/([0-9]+)[/]?$ /account?$2 [R=301,L]
                         ^      ^

But you can just capture one group:

RewriteRule ^accounts/([0-9]+)/?$ /account?id=$1 [R=301,L]
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