I have a website hosted by ionos (formerly 1&1), they have an annoying "feature" (*) whereby an incorrect page request is hijacked and sent to a third party.
The source code for the page I'm redirected to has this script:-
<script type="text/javascript">
document.write(
'<script type="text/javascript" language="JavaScript"'
+ 'src="//sedoparking.com/frmpark/'
+ window.location.host + '/'
+ 'IONOSParkingUK'
+ '/park.js">'
+ '<\/script>'
);
</script>
I was directed to this FAQ which guides me through a custom 404 error page that should prevent this
https://www.ionos.co.uk/help/hosting/html-and-css/create-your-own-error-pages-linux-webhosting
I have set up an .htaccess file like this
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /error_404.html
ErrorDocument 404 /error_404.html
and the error_404.html has this (with my own site instead of example.com):-
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Error 404</title>
</head>
<body>
<h3>This should not have happened. The page you requested does not exist (anymore).</h3>
<p><a href="https://example.com/index.php">Go to the Home page.</a></p>
</body>
</html>
I uploaded both to my website last night but on checking this morning the hijacking is still taking place.
Any ideas what I'm doing wrong? I'm on to IONOS at the moment but wanted thoughts here as well.
(*) I regard this "feature" as a security exposure and reason to move my domain elsewhere and close the account but I need this fixed in the meantime.