Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing whitespace in URLs

Status
Not open for further replies.

Girard747

Technical User
May 28, 2003
3
US
Hey, I am trying to use a program that can use URLs, but it does not convert spaces to %20, and I get a 400 bad request when I try to go the URL. Is there any way to make Apache able to read spaces without giving a 400 error?
 
Spaces must be convereted to %20 or it will not be a valid HTTP request, as such, Apache throws a 400 error at you.

//Daniel
 
So what is creating these spaces in url's normaly Apache would resolve the spaces, are you sure you are passing the url correctly?

If the file is on the Apache server with spaces in the filename then Apache will handle this by default, however if you are clicking a link on server"A" that requests a page on server"B" and the link on server"A" has spaces in the url but the file on server"B" does not (or vica-versa) then you can only expect 404's

Do yoy have access to the server to resolve (fix) the filenames or url's ?

L.
 
It is the program (AIM) which has a crappy browser that doesn't convert spaces to %20... I run the webserver on this computer I am on right now :)
 
btw, the link is something like /index.php?n=a b

and that gives me a 400 :(
 
As I said, it should. Unless you completely hack Apache's request parsing source code, you can't fix it.

//Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top