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

187
Vistas
additional .htaccess in subfolder | mod_rewrite for query parameter

I have a little mod_rewrite problem and really need some help.

I need to have a second .htaccess file in a subfolder for a project on my domain.

The URL to the project is like:

https://example.com/project-name/

Now I have a query parameter for which I want to create a nice URL with mod_rewrite.

The URL including the parameter looks like this:

https://example.com/project-name/index.php?preset=nameofapreset

And I want it to be:

https://example.com/project-name/nameofapreset

The important thing: The mod_rewrite has to work for the current folder only. Without having any info about the current path, cause I need to use the file in other folders, too.

That's what I thought should work (cause I am using a similar rewrite rule in another project):

RewriteEngine On
RewriteRule ^([a-z])/?$ index.php?preset=$1

But it doesn't. And all my trials fail.

Any ideas how I can make it work?

Thanks!

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

0

You can use this rule in /project-name/.htaccess:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ index.php?preset=$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