Redirect to 404 page, if URL alias does not exist I am developing multilingual site in Drupal 8. I added content in Turkish language and did not create any translation for that node.

Suppose node ID is 123, so system URL is http://example.com/tr/node/123. I have managed to redirect the system URL to its alias. So when I go to https://example.com/tr/node/123 I am successfully redirected to https://example.com/tr/custom-node-in-turkish which is perfect.

The problem now is, when I go to https://example.com/node/123 (without tr) or add another language http://example.com/ar/node/123 (ar = Arabic) then I want to redirect the user to the 404 page as these are not the original content.

How can I achieve that in Drupal 8?
You could redirect 301 the specific node id's to 404 using .htaccess file 

Redirect 301 /ar/node/123 /page-not-found