The site structure is as follows:
site.ru/users/ - user list site.ru/users/user/2 - user with ID2
If after the ID, I put a slash (/) and I add any value, then this page also opens. Example:
site.ru/users/user/2/
site.ru/users/user/2/dasd
site.ru/users/user/2/dasd/dasd
site.ru/users/user/2/dasd/dasd/dasd
When you open any link, the page content opens - site.ru/users/user/2/, i.e. we actually have duplicate pages.
The same is true in articles (you can even substitute any value without a slash):
site.ru/articles/articles-title
site.ru/articles/articles-title/dasd
site.ru/articles/articles-titledasd
site.ru/articles/articles-titledasd/dasd
site.ru/articles/articles-title/dasd/dasd
etc.
What can be done so that when opening such pages there is a 404 error? Those. if you open the site.ru/users/user/2 page, it gives the content. If you open the site.ru/users/user/2/xxx page, you get an error 404.
Thank.