Which .htaccess rules work on your hosting

For hosting customers · Updated 2026-10-29

On this page
  1. What works
  2. What does not work, and what to use instead
  3. How fast changes apply
  4. Good to know
  5. Common questions

Websites here are served by OpenLiteSpeed, a fast web server that reads .htaccess files like Apache does for the rules most sites use: URL rewriting (WordPress, Laravel and shop permalinks), blocking access to files and folders, and PHP settings. Some other Apache directives are not applied.

Note: Your hosting provider chooses the web server. If your server uses Nginx instead, .htaccess files are not read at all, and the MIME Types & Handlers page says so.

What works

In .htaccessWhat happens
RewriteEngine, RewriteCond, RewriteRuleApplied, like Apache mod_rewrite. Redirects with [R=301] work.
Deny from all, Require all deniedThe folder (or the files in a <Files> / <FilesMatch> block) is blocked with 403.
Allow from 203.0.113.10, Require ip 203.0.113.0/24Exceptions: these addresses still get through.
<Files> and <FilesMatch> with the lines aboveApplied to the matching file names.
<IfModule mod_rewrite.c> and <IfModule mod_php…>Read through.
php_value / php_flag in the .htaccess at the top of a website's folderApplied as the website's PHP settings (see below).

PHP settings accepted from .htaccess: memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_time, max_input_vars, max_file_uploads, display_errors, date.timezone, output_buffering, short_open_tag, session.gc_maxlifetime, default_charset, zlib.output_compression, mbstring.internal_encoding and allow_url_fopen. Other settings, such as auto_prepend_file, are ignored. Values set on the PHP page take priority over .htaccess.

What does not work, and what to use instead

  • Password protection (AuthType, AuthUserFile, Require valid-user) — use Access Control (section Domains) to password-protect a folder.
  • ErrorDocument — set your own 403, 404, 500 and 503 pages under Redirects (section Domains).
  • AddType and AddHandler — use MIME Types & Handlers.
  • Options +Indexes — directory listing is off by default; turn it on per folder in Access Control.
  • Access lines with conditions that cannot be translated exactly (for example <Limit>, <If>, Satisfy any, address ranges other than /8, /16, /24 or /32) are skipped rather than guessed. Rewrite rules in the same file still work.

How fast changes apply

The server checks for new or changed .htaccess files every minute and reloads gracefully, without dropping visitors. A change you save is live within about a minute. Deleting a .htaccess file also removes its rules within a minute.

Good to know

  • Access rules are read from .htaccess files up to 8 folders deep and smaller than 64 KB.
  • A website with a certificate is always redirected from http:// to https:// by the server; you do not need your own rule for that.
  • A broken rewrite rule can cause a 500 error or a redirect loop. Rename the file to .htaccess-off in the File Manager to test without it.

Common questions

Check that the website's folder has WordPress's .htaccess with its RewriteRule lines. In WordPress, open Settings → Permalinks and click Save to write it again, then wait a minute.

My "Deny from all" does not block anything. Why?

Wait a minute after saving. If it still works, check that the file has no Require line with other conditions (such as Require valid-user) — such files are left alone so that their owner is not locked out.

Was this article helpful?

Still stuck?

Ask the AI about your exact situation — it answers from this knowledge base — or contact us.