20

I have a URL like www.example.com/store/, which leads to a store page

When a user clicks on a discount link, it adds the parameter ?discount=foo, so my link looks like this: www.example.com/store/?discount=foo.

Everything is functional. But is it bad practice to have the forward slash before the query string in this situation?

unor
  • 92,415
  • 26
  • 211
  • 360
Max Martel
  • 203
  • 3
  • 6
  • 2
    It's neither bad practice nor discouraged - in fact, Apache is often configured to add that / if it's not there. – Ben Apr 24 '15 at 18:36

1 Answers1

23

It’s valid:

  1. The path component may end with a slash (/).
  2. The query component starts with the first question mark (?) in the URI.
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360