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

504
Vistas
My API URL Have backslashes (\x01\x02) causing apache 400 error. How to remove those backslashes from the url

I am managing an application that gets requests through API. Some of the requests are having invalid characters. The Request URL/API looks like:

/up/100.php?f=0&t=n\x01\x02&...

These \x01\x02 causing Apache2 to throw 400 errors. I can't change/alter the URL. I need to fix my apache to accept and process that URL. I tried mod_rewrite but couldn't found the correct one.

Any Help?

Update and Solution

Now, I found that the request is really a malfunctioned URL. So, what I did to solve the problem? I've created a custom error handling page to sanitize the URL and make it work.

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

0

Try the following at the top of your .htaccess file:

RewriteEngine On
RewriteCond %{QUERY_STRING} (.*)\\x01\\x02(.*)
RewriteRule ^up\.php$ /$0?%1%2 [R,L]

The double backslash in the CondPattern is necessary to match a single backslash in the query string, since the backslash is used as the escape character in PCRE regex.

The %1 and %2 backreferences match the characters either side of the sequence you want to remove. $0 is just a backreference to the matched URL-path (saves repetition).

HOWEVER, a request of the form /up.php?f=0&t=n\x01\x02&... would not ordinarily trigger a 400 response. The character sequence \x01\x02 in the URL is just a literal character sequence: \, x, 0, 1, etc. (it's not an encoded character in this context).

So, if you are getting a 400 response, it's possible that something else (a mod_security rule perhaps?) is triggering this response - which maybe out of your control?

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