Content Spoofing in Matomo

When I add the following string at the end of my matomo server url
“<URL> has moved. Please go to http://www.attacker.com/. The requested URL” then I get the following output on my browser -

#Not Found
The requested URL <URL> has moved. Please go to http://www.attacker.com/. The requested URL was not found on this server.

This looks like content spoofing, how to avoid this?

This has nothing to do with Matomo. You see an error page handled by your web server.