Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing "/" to "%2f" in URL doesn't work

I have an orchard site and have the following problem:

If I use the URL: http://asiahotelct.com/tours/ct---chau-%C4%91oc---ha-tien-3n2%C4%91, it's okay. But when I change url the / to %2f (like so: http://asiahotelct.com/tours%2fct---chau-%C4%91oc---ha-tien-3n2%C4%91), it no longer works.

Why can / not be replaced by %2f?

like image 866
user1796655 Avatar asked Nov 03 '12 15:11

user1796655


People also ask

What does %3D mean in URL?

is a reserved separator character that cannot appear unencoded in the name and value fields, it must be url-encoded as %3D : custom_field_id%5B%5D%3D10=custom_field_value_10%3DFull-time. It is the receiver's responsibility to url-decode the submitted data before then processing it.


Video Answer


1 Answers

Any url is a kind of complete address to some resource(file) in network. But according to the rules of how it must be actually (to work as you expect), its expected that a few characters must have some specific meaning; just like in this case: "/" means a separator that separates the individual elements of your address(url).

But in case you need such specific characters to be a part of any such element of address(url), we must encode it. List of codes

URL encoding converts characters into a format that can be transmitted over the Internet. - w3Schools

So, "/" is actually a seperator, but "%2f" becomes an ordinary character that simply represents "/" character in element of your url.

like image 144
Satyendra Avatar answered Oct 12 '22 19:10

Satyendra