How to fix 404 errors of Magento?
I tried installing Magento on Debian Wheezy. After installing LAMP on debian, extracting magento to /var/www/magento subfolder (The main cause of problem I thing), chmod -R 777 this subfolder, installing magento from command line (Web based installation wizard didn’t work due to time-out error), accessing the admin module trough http://localhost/index.php/admin, all was set except all links on home page. They were all pointing to a 404 Not found page!
As I told my magento was installed in a sub-folder. Maybe the problem was because of that. I search everywhere and notices some people saying things about mod-rewirte. I also saw this page saying that they had two solutions to choose between and one of them was to enable mod-rewrite on the server! So here cuase me to ask myself: Did I forget to install something on my computer?
That brought me to here.
And from there I found the solution:
sudo a2enmod rewrite
sudo vi /etc/apache2/sites-available/default
Replaced every occurrence of “AllowOverride None” with “AllowOverride all”. Then:
sudo service apache2 restart
And it fixed the problem. Simply there were no mod_rewrite thingy on my computer so that Magento pages for any reason couldn’t be accessed from a subfolder installation.