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

450
Vistas
Editing .htaccess for multiple parameters and pages

I am struggling to understand how to edit my .htaccess file.

Currently i have the following url example.com/fixture.php?country=UK&cup=prem&year=1998&id=123

I would like to achieve example.com/UK/prem/1998/123

On each of the parameters in the URL will have a page for example example.com/UK/prem/ will have info regarding the league and other cups same as the country parameter will have info on the page too.

Currently here is my .htaccess file

RewriteEngine On

RewriteRule ^fixture\.php$ - [L]

RewriteRule ^([^/]+)/?$ /fixture.php?id=$1 [L,QSA]

RewriteRule ^([a-z]{2})/([^/]+)/?$ /fixture.php?country=$1&cup=$2 [L,QSA]

RewriteRule ^([^/]+)/([0-9]+)/?$ /fixture.php?country=$1&cup=$2year=$3&id=$4 [L,QSA]  

Currently I only get a 404 status. I have searched stack overflow and adapted the above code, this is where I think I run into issues....

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

0

With your shown samples, please try following rules set in htaccess file. Please make sure your htaccess file is present in root folder/directory.

Also make sure to clear your browser cache before testing your URLs.

RewriteEngine On
##Blocking direct access to fixture.php here, added NC flag here.
RewriteRule ^fixture\.php$ - [NC,L]

##Rules for handling 4 parameters in uri.
RewriteRule ^([^/]*)/([^/]*)/(\d{4})/\d{3}/?$ /fixture.php?country=$1&cup=$2year=$3&id=$4 [L,QSA]  

##Rules for handling 2 parameters in uri.    
RewriteRule ^([a-zA-Z]{2})/([^/]+)/?$ /fixture.php?country=$1&cup=$2 [L,QSA]

##Rules for handling 1 parameter in uri.
RewriteRule ^([^/]*)/?$ /fixture.php?id=$1 [L,QSA]
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