How to open a URI when the file name contains "?" and "=" characters?

I have a file called index.php?title=dogs in my web directory and I want to open it in a browser. What URL should I enter? When I insert .../index.php?title=dogs , it thinks I'm looking for a file called index.php that does not exist.

+4
source share
2 answers

Hexadecimal value for ? in ASCII is 0x3f, so the URL encoding form is% 3f, and the value = is 0x3d, so% 3d, giving

 .../index.php%3ftitle%3ddogs 

see http://en.wikipedia.org/wiki/Percent-encoding

NB you probably shouldn't be avoided = after you slipped out ?

But you should probably consider changing the file name!

+4
source

Webserver suggests that everything after? is a parameter of the index.php file called QueryString , so it takes it out of the way and then passes it to the index.php file (depending on which web server you have). You can solve the problem using the user settings on the web server .. but personally I do not recommend it.

PS: I did not know that you can create files with that name!

0
source

Source: https://habr.com/ru/post/1440621/


All Articles