###########################################################
#  cPTools emergency block  – place in public_html/.htaccess
###########################################################
  
                  
                RewriteEngine On

# --- Optional: allow your own IP ---
#RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.123$
#RewriteRule ^ - [L]

# --- Force every other request to return HTTP-503 ---
RewriteCond %{REQUEST_URI} !^/robots\.txt$  [NC]
RewriteCond %{REQUEST_URI} !^/favicon\.ico$ [NC]
RewriteRule ^ - [R=503,L]

# --- Inline HTML banner for the 503 ---
ErrorDocument 503 "<!doctype html><html><head><title>Site blocked</title></head><body style='font-family:Arial,sans-serif;margin:2em'><h2>This website has been identified as vulnerable and insecure.</h2><p>Public access has been blocked to protect your data.</p><p>Open the <a href='https://cpanelplugin.com/cptools' target='_blank' rel='noopener'>cPTools&nbsp;plugin</a> in your cPanel to unlock the site and strengthen its security.</p><p>We recommend consulting a developer to resolve the vulnerabilities.</p></body></html>"

# Tell Apache/LiteSpeed to serve the banner as HTML
Header always set Content-Type "text/html; charset=UTF-8" env=REDIRECT_STATUS

# Hint to search engines that downtime is temporary (1 hour)
Header always set Retry-After "3600" env=REDIRECT_STATUS                                          
###########################################################
#  End cPTools emergency block
###########################################################
