0

In my application, I redirect an HTTP request and also pass a parameter. Example:

http://localhost:9000/home;signup=error

Is it better to use a ; or shall I use a ? i.e. shall I do http://localhost:9000/home;signup=error or http://localhost:9000/home?signup=error?

Are the above two different from each other semantically?

unor
  • 92,415
  • 26
  • 211
  • 360
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184

1 Answers1

0

The ? is a reserved character; I have read that this is both valid and invalid, but I have used it for 'slugs' when templating.

Should you choose to use it, percent-encode the query string using %3F which is not human readable, but will produce the ?. (An encoder is recommended)

Perhaps you will find a more suitable solution for your redirects by adding an .htaccess file to your project.

Mister Moody
  • 114
  • 1
  • 10