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

342
Vistas
Redirect 2 urls (%20) to one in nginx

I have this problem that I can't solve. I have a nginx server that I have to make a redirect of this type.

http://midomain.com/xxxx/xxxx/ http://wikipedia.com/xx --> http://midomain.com/yyyy

As I have two urls with a space, there is no way to make it work.

I have tried multiple ways.

rewrite ^/xxxx/xxxx/\ http://wikipedia.com/xx http://midomain.com/yyyy permanent;
rewrite "^/xxxx/xxxx/\ http://wikipedia.com/xx" http://midomain.com/yyyy permanent;
rewrite ^/xxxx/xxxx/%20http://wikipedia.com/xx http://midomain.com/yyyy permanent;
rewrite "^/xxxx/xxxx/%20http://wikipedia.com/xx" http://midomain.com/yyyy permanent;
rewrite ^/xxxx/xxxx/\ http://wikipedia.com/xx/$ http://midomain.com/yyyy permanent;
rewrite "^/xxxx/xxxx/\ http://wikipedia.com/xx/$" http://midomain.com/yyyy permanent;
rewrite ^/xxxx/xxxx/%20http://wikipedia.com/xx/$ http://midomain.com/yyyy permanent;

I don't know if I'm doing something wrong.

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

0

Nginx normalises the URI before processing it through rewrite. The %20 is resolved to a literal space character and consecutive / characters are replace by a single /. It's that last point that's causing you problems.

For example:

rewrite "^/xxxx/xxxx/ http:/wikipedia\.com/xx$" http://midomain.com/yyyy permanent;
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