Updated to Ubuntu 14.04 (with Apache), .htaccess no longer redirects on 404 errors

August 20, 2014 3.3k views

Running a few virtual hosts with sites via my droplet, upgraded to Ubuntu 14.04.1, and now none of my previously established 404 redirects work (just getting the default "Not Found - The requested URL /404 was not found on this server." with a bad URL).

Here is essentially what each of those .htaccess files looks like, for reference:

Options +FollowSymLinks -MultiViews -Indexes

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

ErrorDocument 404 /
ErrorDocument 403 /

AddType video/mp4 .mp4 .m4v
AddType video/webm .webm
AddType video/ogg .ogv .ogg

Within the configuration files for the sites-enabled (under /etc/apache2), I have these in place:

        <Directory /var/www/kyleconrad.com>
                Options All
                AllowOverride All
        </Directory>

Like I said, haven't changed them, haven't changed any permissions or the like (that I know of), but getting failures with no redirects on 404 errors. Am I missing something here?

1 Answer

So after much effort, figured out what it was and might help others updating to Ubuntu 14.04 - found via Stack Overflow, you now must have all virtual hosts files end in .conf as opposed to no extension as before.

Went through, manually added .conf to all the files, then reactivated them with a2ensite and a "service apache2 reload" after each virtual host and everything seems to be back up and running - including the htaccess files.

Have another answer? Share your knowledge.