http://www.example.com/test1
http://www.example.com/test2
http://www.example.com/test3
all of these are non-existent pages and redirects to the index.php page, the search engines marks those links as duplicates, they return 200 ok, how to make them return 404 not found?
using modX cms
By default, MODX serves up the home page when it can't find a page that matches the request if you haven't defined an error page.
Create a new resource to serve as your 404 page, then go to System > System Settings, search for error_page and add the ID of your error resource there.
MODX will then serve this resource for 'not found', automatically adding in the HTTP/1.1 404 Not Found header.
Note: I'm assuming you're using MODX Revolution, but it's very similar for Evolution.
Under the assumption that you own those pages.
header("HTTP/1.1 404 Not Found");
exit;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With