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

145
Vistas
PHP changed Parameter redirect by htaccess

I want to redirect my dynamic links to new parameter.

My Old code for Files:

https://www.example.com/index.php?a=browse&b=category&id=[DYNAMIC ID IN NUMBERS]

I want new for Files :

https://www.example.com/index.php?a=downloads&b=file&id=[DYNAMIC ID IN NUMBERS]

How to do that in .htaccess?

My current .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) https://www.example.com/$1 [R=301,L]
</IfModule>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

To redirect the "old" URL to the "new" whilst maintaining the "old" dynamic id, try the following before your existing directives:

RewriteCond %{QUERY_STRING} ^a=browse&b=category&id=(\d+)
RewriteRule ^(index\.php)$ https://www.example.com/$1?a=downloads&b=file&id=%1 [R=301,L]

The $1 backreference simply matches index.php and saves repetition.

The %1 (as opposed to $1) is a backreference to the captured pattern in the preceding CondPattern ie. the value of the id URL parameter.

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