How to change url?

The goods are displayed on the home page at "/".
The behavior that I want to achieve:
What happens (extra slash):
April 4th 20 at 00:57
1 answer
April 4th 20 at 00:59
Solution and two identical addresses. If after a domain is nothing, then the slash can be omitted. If there is a query parameter, then the slash is required. Without it in any way.

Find more questions by tags React