---
title: "How to allow or block hostnames and IP addresses in SiteWorx"
source: "https://docs.nexcess.com/sites-stores/control-panel/interworx/siteworx/security/allow-or-deny-access-via-htaccess/"
description: "Use SiteWorx to allow or block specific hostnames and IP addresses while managing permissions for a site or domain directory."
vertical: "Sites & Stores"
date: "2019-09-10"
last_modified: "2026-07-02"
---

# How to allow or block hostnames and IP addresses in SiteWorx

## Prerequisites

- A backup of your .htaccess file
- An enabled global or directory-specific .htaccess file. See [How to create .htaccess files](https://www.liquidweb.com/blog/how-to-create-htaccess-files/) for details

## Step by step instructions

The hostnames and IP addresses you intend to add to the **Trusted** or **Blocked** fields will apply to the current directory and all of its subdirectories.

1. Log in to your SiteWorx account. 
    - If you do not know your password, click Forgot your password on the login page.
2. From the main menu, click **Hosting Features > Htaccess**.
3. Locate your desired directory, then click **\[Edit\]**.![](https://docs.nexcess.com/wp-content/uploads/2026/06/1568141912756-1568141912756.png)
4. Locate your desired directory, then click **Access Control**.  
    Reference the below image for steps 5–8.![](https://docs.nexcess.com/wp-content/uploads/2026/06/1568141944546-1568141944546.png)
5. From the **Access Order** panel, select the order in which **trusted** or **blocked”**lists should be considered: 
    1. Deny first, then allow: **Blocked Hosts** list will be evaluated first.
    2. Allow first, then deny: **Trusted Hosts** list will be evaluated first.
6. Type the domain names or IP addresses in the **TrustedHosts** field. The domain names and IP addresses listed will be allowed access to this directory and all of its sub-directories.
7. Type the domain names or IP addresses in the **Blocked Hosts** field. The domain names and IP addresses listed will be denied access to this directory and all of its sub-directories.
8. Click **Update**. A message will display at the top of the page indicating that access control has been enabled for the directory that you selected; for example, Access Control updated: global.
