Force 404

This article outlines how to set all website pages to 404 using.htaccess and Rewrite conditions. Access the cPanel account for the website you wish to redirect. Check.dotfiles are set to visible. Edi…

Zak Guy
Updated by Zak Guy

This article outlines how to set all website pages to 404 using .htaccess and Rewrite conditions.

  1. Access the cPanel account for the website you wish to redirect.
  2. Check .dotfiles are set to visible.
  3. Edit the .htaccess file and add the code below to the top of the file.
  4. Save the changes and the site will now display a 404 error when visited.
<IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{HTTP_HOST} ^exampledomainname.co.uk$ [OR]
            RewriteCond %{HTTP_HOST} ^exampledomainname.co.uk$
            RewriteRule (.*)$ https://www.exampledomainname.co.uk/$1 [R=404,L]
          </IfModule>

How did we do?

Cleaning hacked sites

Powered by HelpDocs (opens in a new tab)

Contact