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

252
Vistas
htaccess: redirect article one level deeper without loop

I have a url like this:

https://example.com/product/my-product-name

I need to redirect to:

https://example.com/product/item/my-product-name

I tried multiple solutions, also solutions I've found here on SO, but I ended up on infinite loops when I accessed /product (which shall NOT redirect) and also multiple redirects when I called the "old" product.

So: https://example.com/product/item/my-product-name

shall NOT redirect.

https://example.com/product/my-product-name shall redirect to https://example.com/product/item/my-product-name

and

https://example.com/product/ and https://example.com/product shall NOT redirect.

Can anybody help me on this? Thanks!

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

0

You may use this redirect rule your topmost rule in site root .htaccess:

RewriteEngine On

RewriteRule ^(product)/(?!item/)(.+)$ /$1/item/$2 [L,NE,R=301]

Make sure to clear your browser cache before testing this change.

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