Turning on URL Rewriting broke my site
Your server needs mod_rewrite (Apache) or a rewrite rule (Nginx). Ask your host, or set RewriteBase in .htaccess if Joomla is in a subfolder.
Why it happens
With URL rewriting on, every address goes to index.php through a server rule. If the rule isn't there or doesn't fit your server, pages give 404 (rule missing) or 500 (rule not allowed or wrong).
Fix it
- Check the file is called exactly
.htaccess(with the dot, not.htaccess.txt) and sits in the Joomla folder. - Apache needs mod_rewrite enabled and
AllowOverrideset so.htaccessis read. Ask your host if unsure. - If Joomla is in a subfolder, open
.htaccess, uncommentRewriteBaseand set it to the folder, for exampleRewriteBase /mysite. - A 500 right after renaming usually means your host doesn't allow some lines (for example
Options +FollowSymLinks). Comment them out one by one with#. - On Nginx, add the
try_filesrule instead;.htaccessdoes nothing there. - Need your site back now? Set
$sef_rewrite = false(or0) in configuration.php.
Sources
- The htaccess.txt file – Joomla User Guide
- SEF URLs on Apache – Joomla User Guide
- SEF URLs on Nginx – Joomla User Guide