Report this

What is the reason for this report?

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

Posted on August 20, 2014

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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.