This question already has an answer here:
- urlencoded Forward slash is breaking URL 12 answers
I need to pass / as a variable as part of a URL.
My structure looks like this: www.domain.com/listings/page-1/city-Burnaby+South/type-Townhome/bedroom-2/bathroom-2
In this case, it ultimately boils down to listings.php and everything else beyond it becomes parameters taht my PHP script parses through using the $_SERVER['REQUEST_URI'] var.
However when one of hte variables becomes "Apartment/Condo" and the / becomes %2F via urlencode() in PHP when the URL is generated, the whole thing chokes and I get a "Not Found" error.
How do I pass the / without breaking the URL? What am I missing? I thought the whole point of these urlencode() characters (%2F, %20 etc.) were there to escape these issues.