Can't access game with special path

My game works fine at http://localhost:7456
However, I want to access the game using the path http://localhost:7456/abc/123, but it says 404 - Not Found
What should I do?

Please clearly specify what you want to access using the path above.

My game needs some initialization values from the server (abc and 123), my server appends these values to the url and returns it to the user.

When I visit http://localhost:7456/abc/123 it shows like http://localhost:7456 (this show my game). I will then take the values abc and 123 from url into my game.

I used to do it like this: http://localhost:7456/?value1=abc&value2=123 this does exactly what i want and i can get the values with the code:
new URLSearchParams(window.location.search).get("value1").

I was just wondering can I do the same by http://localhost:7456/abc/123?

I think that http://localhost:7456/?value1=abc&value2=123 is the best (and only) solution.

The address you access http://localhost:7456/ actually navigates you to file http://localhost:7456/index.html, which is a HTML file initiating the game window for you.

So that your desired address (http://localhost:7456/abc/123) guides you to the game root localhost:7456 → then folder abc → then folder 123 → then file index.html. Clearly those folders and the file are not existed in your game folder.

I believe that slashes must be used only for site navigations, not for passing parameters.

2 Likes