.htaccess files in Agency Hosting

Updated 3 weeks ago

Agency Hosting uses Nginx web server architecture, which doesn’t support .htaccess files. If you’re migrating from Apache-based hosting, your .htaccess configurations won’t work automatically.

Good news: Everything you did with .htaccess can be accomplished through our hPanel.

Why Nginx doesn’t use .htaccess

Performance: Nginx loads configurations once at startup, while Apache reads .htaccess files on every request. This makes Nginx significantly faster.

Security: Centralized configuration prevents accidental misconfigurations that could expose your site or impact performance.

Optimization: Our infrastructure team ensures all configurations follow best practices for speed and security.

Common .htaccess tasks & Agency hosting alternatives

1. URL Redirects

Old way (.htaccess):

Redirect 301 /old-page.html /new-page.html

RewriteRule ^old-category/(.*)$ /new-category/$1 [R=301,L]

Agency hosting way:

Use the Redirects feature in your control panel:

  1. Navigate to your website settings
  2. Go to Domains – Redirects section inside your website dashboard
  3. Select the URL path you want to redirect from and to:

2. IP Blocking & Access Control

Old way (.htaccess):

Order Deny,Allow

Deny from 192.168.1.100

Allow from all

Agency hosting way:

Use the IP Blacklist feature:

  1. Go to Security section in your website dashboard
  2. Select IP Blackslist
  3. Add IP addresses to block
  4. Save changes

3. Force HTTPS

Old way (.htaccess):

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Agency hosting way:

SSLs are installed automatically. But if you want to install a Custom SSL, you can do that by following these steps

  1. Go to Security section in your website dashboard
  2. Select SSL
  3. Click “Manage” and “Install custom SSL”

  4. Follow instructions shown in the modal