I have correctly configured the resource id in the "site" section in the system settings. But when I enter a mysite/ non-existentaddress in the browser, instead of a redirect to 404, a redirect to the main page occurs
I tried to add in my htacceess file redirect to 404, but it didn’t help
So your error_page
system setting has published resource ID as desired 404 page, right?
What do you see here https://www.redirect-checker.org/index.php checking yoursite/non-existentaddress URL?
This setting should work without any htaccess additions, please comment them if any.
BTW how about friendly URLs, is it active now?