Fixing 404 Errors In Magento/Ubuntu

« Return to Blog

Recently I got a new Ubuntu server and decided that I'd use it as a development server for projects. So after installing the required software to run it as a web server I decided to install Magento (ver 1.5.1.0) for some testing. After following the SSH instructions on Magento's site and successfully installing it...I ran in to a problem.

Every page except the homepage would produce a 404 error. Which as you can imagine wasn't ideal. So how did I fix it?

Well the fix was extremely easy...if you know where to look. You need to edit a file called 000-default. Run this command to edit the file:

sudo nano /etc/apache2/sites-enabled/000-default

Then changed AllowOverride None to AllowOverride All.

Magento 404 - Allow Override Fix

Do a quick restart of your server using the following command

sudo service apache2 restart

Apache2 Magento Restart

And your problems should be solved. If you ran into this problem or if you have another problem I'd love to hear about it in the comments below!