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

152
Vistas
Rewriting a URL causing a 400 Bad Request

I'm trying to get around an HTTP 400 Bad Request with Apache that is caused when this URL is accessed (actual domain redacted):

http://example.com/nw/f/RUD/E.enc<space>

The URL ends with an actual space character, thus giving an HTTP 400 Bad Request. I cannot get the clients requesting this to remove the space in the URL, so I need to rewrite the URL without a space.

I've tried some RewriteRules, like this one (after enabling the RewriteEngine):

RewriteRule "^/nw/f/RUD/E(.*)$" /nw/f/RUD/E.enc [P]

The RewriteRule has no effect and is still giving an HTTP 400.

It even happens when I escape the space character instead of using the wildcard in the rule. Same thing if I try to replace the HTTP 400 error page to lead to the actual content (which wouldn't be ideal, since there's 4 different files).

How can I correctly rewrite the URL, removing the space on it, without getting HTTP 400?

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

0

Your RewriteRule produces a redirect loop as .../E.enc<space> and .../E.enc both match .../E(.*)$. Better use a [R]edirect, though proxying also works.

RewriteEngine On
RewriteRule "^/nw/f/RUD/E\.enc $" /nw/f/RUD/E.enc [R,L]

or shorter

RewriteEngine On
RewriteRule "^(/nw/f/RUD/E\.enc) $" $1 [R,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