Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it correct to have the query parameters directly after a slash in a URL?

Tags:

url

Im getting a 304 redirect from A to B:

  • A http://example.com/path?value1=a&value2=b
  • B http://example.com/path/?value1=a&value2=b

Is B the correct form or is the server at fault?

like image 396
Robert Avatar asked Sep 02 '13 14:09

Robert


Video Answer


1 Answers

URLs representing directories are usually ended in trailing slashes, but the URL itself is filesystem-agnostic, so both ways are correct.

The trailing slash is almost certainly done by Apache's mod_dir. The documentation contains some points why is this a good practice. Although:

If you don't want this effect and the reasons above don't apply to you, you can turn off the redirect ...

like image 175
vbence Avatar answered Sep 23 '22 04:09

vbence