A Joomla 500 error on mod_rewrite is almost always Apache rejecting a directive in your root .htaccess file right after you enable Search Engine Friendly URLs or “Use URL rewriting.” The browser only shows Internal Server Error. The Apache error log names the real cause: usually Options +FollowSymLinks, a missing AllowOverride, disabled mod_rewrite, or a bad RewriteBase.
This guide is the fix path we use on Joomla 4, 5, and 6 sites (and older 3.x still on Apache). It complements our deeper Joomla .htaccess guide and the Joomla SEF URL setup.
What you will learn
- How to prove the 500 is caused by
.htaccess/ mod_rewrite in under two minutes - The exact Apache log messages that map to each fix
- How to repair FollowSymLinks, AllowOverride, mod_rewrite, and RewriteBase
- How to rebuild a clean Joomla
.htaccessfromhtaccess.txt - What to check in Global Configuration and conflicting extensions
Why Joomla shows 500 after enabling URL rewriting
Joomla SEF without rewriting still works with index.php in the URL. Turning on Use URL rewriting tells Joomla to drop index.php and rely on Apache mod_rewrite plus the rules in .htaccess (renamed from the shipped htaccess.txt).
If Apache cannot apply those rules, every front-end request can return HTTP 500. The administrator may still load if you open it with a direct /administrator/ path, which is a useful clue.
| Symptom / log clue | Most likely cause | First fix |
|---|---|---|
| Site dies only after enabling URL rewriting | .htaccess active and rejected |
Rename .htaccess to restore the site, then fix the directive |
Options not allowed here or FollowSymLinks error |
Host forbids Options in .htaccess |
Comment out Options +FollowSymLinks |
.htaccess ignored, URLs 404 |
AllowOverride None |
Set AllowOverride All (or FileInfo Options) in the vhost |
Invalid command RewriteEngine |
mod_rewrite not loaded |
Enable the module and restart Apache |
| Works in root, breaks in subdirectory | Wrong RewriteBase |
Set RewriteBase /subfolder/ |
| Works until a security extension ships custom rules | Broken rewrite block from a plugin | Disable the extension, restore core SEF section |
Step 1: Prove it is the .htaccess file
- Via FTP or file manager, rename root
.htaccessto.htaccess.bak. - Reload the homepage.
- If the 500 disappears (even if SEF URLs look ugly again), the rewrite file is the culprit.
Do not leave rewriting enabled in Global Configuration while .htaccess is missing, or you will get 404s on pretty URLs. Temporarily turn Use URL rewriting off, then continue.
Step 2: Read the Apache error log
Guessing wastes time. Open today’s error log (cPanel “Errors”, Plesk logs, /var/log/apache2/error.log, or your host’s equivalent) and reload the site once.
Look for lines that mention .htaccess, Options, RewriteEngine, or AllowOverride. Match them to the table above before editing Joomla again.
Step 3: Fix Options +FollowSymLinks (the most common 500)
Joomla’s shipped htaccess.txt includes Options +FollowSymLinks because mod_rewrite historically needed it. Many shared hosts already set symlink policy in the virtual host and forbid changing Options from .htaccess. Apache then returns 500 with “Options not allowed here.”
In your .htaccess, comment the line:
# Options +FollowSymLinks
Some hosts prefer:
Options +SymLinksIfOwnerMatch
Official Joomla docs note that if commenting FollowSymLinks restores the site and SEF still works, your administrator already set the option server-side and you should leave it commented. See Preconfigured htaccess and Enabling SEF URLs.
Step 4: Confirm AllowOverride permits .htaccess
If you control the server (VPS, dedicated, local XAMPP/WAMP), open the virtual host or httpd.conf <Directory> block for the site document root and ensure overrides are allowed:
<Directory "/var/www/html">
AllowOverride All
Require all granted
</Directory>
On shared hosting you usually cannot edit this. If AllowOverride is None, ask support to enable .htaccess overrides for Options and FileInfo, or to enable Joomla URL rewriting for your account.
Restart Apache after config changes.
Step 5: Enable mod_rewrite
On Debian/Ubuntu:
sudo a2enmod rewrite
sudo systemctl restart apache2
On RHEL/Alma/CloudLinux, ensure this line is uncommented in the Apache config and restart:
LoadModule rewrite_module modules/mod_rewrite.so
Quick PHP check on a throwaway file (delete after testing):
<?php
print_r(apache_get_modules());
If mod_rewrite is missing from the list (or apache_get_modules is unavailable under PHP-FPM), confirm with your host. Without the module, leave Joomla URL rewriting off. SEF can still run with index.php in the path.
Step 6: Rebuild .htaccess from htaccess.txt
Corrupt or hand-edited rewrite blocks are a frequent source of 500s. Joomla ships a known-good template as htaccess.txt in the site root.
- Download a fresh copy from your Joomla version package if the root file is missing.
- Copy
htaccess.txtto.htaccess(merge carefully if you already have custom redirects). - Comment
Options +FollowSymLinksif Step 3 applied. - Keep core SEF rules inside the
<IfModule mod_rewrite.c>block.
Core SEF section (simplified shape; prefer the full file from your Joomla version):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
RewriteRule .* index.php [L]
</IfModule>
Never paste truncated snippets that smash the title or other text into the middle of a RewriteCond line. That alone will 500 the site.
Step 7: Set RewriteBase for subdirectory installs
If Joomla lives at https://example.com/shop/, set:
RewriteBase /shop/
Root installs usually use RewriteBase /. Wrong base values produce 500s or broken asset paths after rewriting is enabled.
Step 8: Align Global Configuration
In System → Global Configuration → Site (wording varies slightly by Joomla 4/5/6):
- Search Engine Friendly URLs: Yes
- Use URL rewriting: Yes only after
.htaccessworks - Adds Suffix to URL: optional
- Unicode Aliases: as needed for non-ASCII
Save, clear Joomla cache, then test a menu item URL. If enabling rewriting brings the 500 back, return to Steps 2 and 3. Keep SEF on and rewriting off until Apache is clean.
Step 9: PHP-FPM Authorization line and host extras
Some hosts need the HTTP Authorization pass-through for API or extension auth:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
That line belongs in the core SEF section of a current Joomla .htaccess. Removing it rarely causes a 500, but a broken duplicate of it can. Also watch for host-injected blocks (LiteSpeed, Imunify, custom php_flag lines) that are invalid on your PHP handler. Comment suspect lines one at a time while watching the error log.
Step 10: Rule out extensions and security plugins
After the core file works, re-enable custom redirects and security rules carefully.
- Disable recently installed SEF, security, or “firewall” extensions that write rewrite rules.
- Check for a second
.htaccessin/administratoror a subdomain docroot. - Restore from backup if a malware cleanup left garbage rewrite conditions.
If the site was compromised, fix rewriting only after a clean restore. See our guide on repairing a hacked Joomla website.
Nginx and IIS note
mod_rewrite is an Apache module. Nginx uses try_files toward index.php. IIS uses web.config. A “mod_rewrite 500” on those stacks usually means you are reading Apache advice on the wrong server. Ask the host which web server fronts PHP before editing .htaccess.
Key takeaways
- A Joomla 500 right after enabling URL rewriting is an Apache
.htaccessproblem until the error log proves otherwise. - Commenting
Options +FollowSymLinksfixes the majority of shared-hosting cases. - Rename
.htaccessto restore the site, then rebuild fromhtaccess.txt. - Enable
mod_rewriteand correctAllowOverride/RewriteBasebefore turning rewriting back on in Joomla. - Keep Global Configuration rewriting off until a homepage request returns 200 with the fixed file in place.
Frequently asked questions
Why do I get a Joomla 500 error when I enable mod_rewrite?
Apache is rejecting a directive in .htaccess, most often Options +FollowSymLinks, or mod_rewrite is not allowed. Check the error log, then comment FollowSymLinks and confirm AllowOverride.
Is the administrator also down during a rewrite 500?
Not always. /administrator/ can still load while the public site 500s. That pattern strongly points at front-end rewrite rules rather than a total PHP crash.
Should I delete .htaccess permanently?
No. Use a rename only to diagnose. Joomla needs a valid .htaccess for clean SEF URLs and basic exploit blocking from the core template.
Does this apply to Joomla 5 and Joomla 6?
Yes. The SEF and htaccess.txt flow is the same family on Joomla 4, 5, and 6. Always copy htaccess.txt from your exact version package.
What if I am on Nginx?
Do not chase mod_rewrite. Configure Nginx try_files $uri $uri/ /index.php?$args; (or your host’s Joomla snippet) instead of Apache .htaccess.
Can a plugin cause a rewrite 500?
Yes. Security and SEF extensions sometimes append invalid rules. Disable recent extensions, restore the core SEF block, then re-add custom rules one by one.
Where can I get a clean Joomla htaccess file?
From the htaccess.txt in your Joomla root or install package. Our htaccess for Joomla article covers version-specific notes and hardening.
