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

323
Vistas
How do i make a htaccess variable optional?

How do i make that the third passed 'get' variable on first line is not mandatory? In other words, page only works if there are 3 'get' variables given, but in my case, i need the third one (e) to be optional. Any ideas?

RewriteRule ^ft/([0-9]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ forum.php?ft=$1&seo=$2&e=$3 [NC,QSA,L]
RewriteRule ^(fc|ft)/([0-9]+)/?$ forum.php?$1=$2 [NC,QSA,L]
RewriteRule ^forums/?$ forum.php [NC,L]
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

In that case to handle both 2 and 3 variables, try adding 1 more rules in your htaccess Rules file, have your htaccess rules file in following manner.

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

RewriteEngine ON
##Newly added rewrite Rule to handle 2 parameters in uri.
RewriteRule ^ft/([0-9]+)/([A-Za-z0-9-]+)/?$  forum.php?ft=$1&seo=$2 [NC,QSA,L]

##Rest of the rules go from here onwards....
RewriteRule ^ft/([0-9]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ forum.php?ft=$1&seo=$2&e=$3 [NC,QSA,L]
RewriteRule ^(fc|ft)/([0-9]+)/?$ forum.php?$1=$2 [NC,QSA,L]
RewriteRule ^forums/?$ forum.php [NC,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