> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://wiki.volthosting.co.uk/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Take Your Website Offline


# How to Take Your Website Offline

There are times when you may need to make your website temporarily or permanently inaccessible, whether for maintenance, applying security updates, or addressing critical issues. This guide outlines several methods to safely disable your website.

## 1. Restrict Access with .htaccess (IP-Based Restriction)

If you need to take the site offline for most visitors while still allowing access for yourself, you can use `.htaccess` to block all IPs except your own.

### Steps:

1. Open the `.htaccess` file in your website’s root directory (usually located in `/public_html/`).

2. Add the following code:

```apache
Order deny,allow
   Deny from all
   Allow from YOUR-IP-HERE
```

3. Replace `YOUR-IP-HERE` with your actual IP address. ( *Need to find your IP? [Check it here](https://whatismyipaddress.com/)*.)

4. To allow access for multiple IPs, add additional `Allow from YOUR-IP-HERE` lines for each IP.

**Result:** Only specified IP addresses will be able to access your website, while all others will be blocked.

## 2. Remove Website Files

A straightforward way to take your website offline is by removing or moving its files from the public directory. This will result in a `404 Not Found` error for any visitors.

Steps:
1. Log into Your cPanel or Plesk Account:
* For cPanel: Open `File Manager`.
* For FTP: Connect to your server using an FTP client (e.g., FileZilla).
* For Plesk: Open `Files`

2. Navigate to Your Website Directory:
* Go to `/public_html/` if your site files are in the main directory.
* If your site is in a subfolder or is an add-on domain, navigate to that specific folder.

3. Create a Backup (Optional):

| Note: With cPanel or Plesk, daily backups will be made automatically with JetBackup, but it is always recommended to create a manual backup first.

* To preserve your data, select all files in the website folder.
* In cPanel or Plesk: Click `Compress` to create a zipped backup, or download the files via FTP.
* Store the backup on your computer or a secure cloud storage service.

4. Delete or Move Files:
Select all files and either:
* Click `Delete` to remove them, or
* Move them to a non-public folder (e.g., `/backup/`).

**Result:** Once files are deleted or moved, visitors will see a `404` error. If you have a custom `404` page, it will display instead.

## 3. Take the Site Offline by Adjusting DNS Settings

Changing your site’s DNS settings can effectively take it offline by preventing the domain from resolving.

Steps:
1. Log into Your DNS providers dashboard, if using VoltHosting nameservers, on cPanel, head to `Zone Editor`, or if using Plesk, head to `DNS`.
2. Modify DNS Records:
* Locate the `A record` for your domain and update it to an invalid IP address like `127.0.0.1`.
* Alternatively, delete the A record entirely to stop DNS resolution.

**Result:** Your domain will no longer point to your web server, taking your site offline for all users.

## 4. Use Maintenance Mode for Temporary Downtime

If you need to take your site offline temporarily, consider redirecting visitors to a maintenance page using `.htaccess`.

Steps:
1. Create a Maintenance Page:
* Create a `maintenance.html` file with a message for your visitors, explaining the temporary downtime.

2. Set Up the Redirect:

* Add the following code to your .htaccess file to redirect all visitors to the maintenance page:
```apache
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/maintenance.html$
RewriteRule ^(.*)$ /maintenance.html [R=307,L]
```

**Result:** Visitors will be directed to your maintenance page until you remove the redirect rule.

For further assistance, feel free to reach out to the VoltHosting support team.