Getting default site in Apache2 to display a 404

Rather than showing the alphabetically first virtualhost (alphabetically based on file name, if you have one file for each virtualhost, otherwise it will show whatever’s at the top of your single virtualhost file).

<VirtualHost *:80>
    Redirect 404 /.*
</VirtualHost>

I’m getting some errors when trying to do the same with SSL sites, out of time now but will try and sort another day.

Leave a Reply

Your email address will not be published. Required fields are marked *