Enable Mod Rewrite

htaccess & Redirects | Updated March 2026

mod_rewrite is the Apache module that powers URL rewriting, clean URLs, and redirects in .htaccess files. On Ultra Web Hosting, mod_rewrite is already enabled on all servers. If your rewrite rules aren't working, the issue is in the rules themselves, not the module.

01. mod_rewrite Status

Both mod_rewrite and AllowOverride All are enabled server-wide. You don't need to request activation, edit Apache config files, or contact support to enable them. Every .htaccess file in your account's directories is processed automatically.

02. Why Rewrite Rules Might Not Work

If your rewrite rules aren't taking effect, check these common issues:

Missing RewriteEngine On - This directive must appear before any RewriteRule or RewriteCond lines. Without it, all rewrite rules are silently ignored.

# This is required at the top of your rewrite block
RewriteEngine On
RewriteRule ^old-page$ /new-page [R=301,L]

.htaccess file is unreadable - If the file permissions are wrong (not 644) or ownership is incorrect, Apache can't read it. See our htaccess readable error guide.

Rules in the wrong order - Apache processes rewrite rules top to bottom. If an earlier rule matches first and has the [L] (last) flag, subsequent rules never execute. Put more specific rules above general ones.

WordPress overwrites your rules - WordPress regenerates the content between # BEGIN WordPress and # END WordPress when you save permalink settings. Custom rules must go above or below this block, never inside it.

Syntax errors - A malformed RewriteRule can cause a 500 Internal Server Error. Check the Apache error log in cPanel (Metrics > Errors) for the specific syntax issue.

03. Nginx Reverse Proxy Considerations

Ultra Web Hosting servers use ea-nginx as a reverse proxy in front of Apache. Most .htaccess rewrite rules work normally because nginx passes dynamic requests to Apache. However, some edge cases can cause unexpected behavior:

Static file caching - Nginx may serve cached static files (images, CSS, JS) directly without consulting .htaccess. If you have rewrite rules for static file URLs, they may be bypassed.

Redirect loops - If nginx and .htaccess both try to redirect the same URL (e.g., HTTP to HTTPS), you can get an infinite redirect loop. See our Nginx and .htaccess redirect issues guide.

04. Verifying mod_rewrite Is Loaded

If you want to confirm mod_rewrite is active on your account, create a temporary PHP file:

<?php
if (in_array('mod_rewrite', apache_get_modules())) {
    echo 'mod_rewrite is enabled';
} else {
    echo 'mod_rewrite is NOT enabled';
}
?>

Or via SSH: apache2ctl -M 2>/dev/null | grep rewrite

For the complete guide to rewrite rules with examples, see our .htaccess guide. For SEO-friendly URLs, see SEO Friendly URLs.

Rewrite Rules Not Working?

If you've checked the common issues above and your rules still aren't working, open a ticket with the .htaccess content and the URL you're testing.

Open a Support Ticket

Quick Recap: mod_rewrite on Ultra Web Hosting

  1. mod_rewrite is already enabled on all accounts
  2. Include RewriteEngine On before any RewriteRule directives
  3. Check file permissions - .htaccess must be 644
  4. Put custom rules outside the WordPress block
  5. Check nginx interaction if redirects behave unexpectedly

Last updated March 2026 · Browse all htaccess articles

  • 152 Users Found This Useful

Was this answer helpful?

Related Articles

How can I tell how much disk space I have available?

Article Updated This article has been consolidated Disk space information is now part of...

Is it possible to make a cron to backup my database at specific times?

Hosting Control Panel | Updated March 2026 Yes, you can schedule automatic database backups...

I have a reseller account. What can I use for billing software and automation?

General | Updated 2026 If you have a reseller hosting account with Ultra Web Hosting and need...

When I type in my domain it goes to ultrawebhosting.com

General | Updated 2026 If you type your domain name into a browser and see the Ultra Web...

Common Search Engine Optimization Tips

General | Updated 2026 Search engine optimization does not have to be complicated. Here are...



Save 30% on web hosting - Use coupon code Hosting30