Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just restored our Magento website on a different server running apache2 on ubuntu. The home page pulls up just fine but if I try to go to any other page, I get a 404.


  • All files are 660
  • All directories are 770 All files and directories
  • All files and directories belong to the www-data group

Things I've Tried

  • check all the website and store ids
  • add /index.php/ between the domain and page path
  • clear temporary files

Nothing appears in the log files other than the standard 404 lines in the access.log and error.log.

apache2 .conf file

<VirtualHost *:80>

    DocumentRoot "/var/www/default/"
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory "/var/www/default/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        php_admin_flag engine on
        php_admin_value open_basedir none

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined



DirectoryIndex index.php

<IfModule mod_php5.c>
    php_value memory_limit 10G
    php_value max_execution_time 1800000
    php_flag magic_quotes_gpc off
    php_flag session.auto_start off
    php_flag suhosin.session.cryptua off
    php_flag zend.ze1_compatibility_mode Off

<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off

<IfModule mod_deflate.c>

<IfModule mod_ssl.c>
    SSLOptions StdEnvVars

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]

AddDefaultCharset Off

<IfModule mod_expires.c>
    ExpiresDefault "access plus 1 year"

Order allow,deny
Allow from all

    order allow,deny
    deny from all

Log File Output

==> /var/log/apache2/oem1-error.log <==
[Tue Oct 15 12:32:21 2013] [error] [client] File does not exist: /var/www/gearhead_oem1/admin

==> /var/log/apache2/oem1-access.log <== - - [15/Oct/2013:12:32:21 -0600] "GET /admin HTTP/1.1" 404 507 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36"
share|improve this question
up vote 1 down vote accepted

Sounds like a problem with rewrites. In Ubuntu:


a2enmod rewrite
apt-get install php5-curl

and then:

service apache2 restart

mod_rewrite and php-curl will now be enabled!

share|improve this answer
I also added php5-curl to your answer. a2enmod rewrite got me most of the way there but I was still getting some curl errors. – eisaacson Oct 15 '13 at 22:35

Php requires different permissions. Magento recommends the following:

find . -type d -exec chmod 775 "{}" \;
find . -type f -exec chmod 664 "{}" \;
share|improve this answer
Thank you. Giving more permission to the public doesn't change anything. If it was a permissions issue, it would have been a permissions error. Just for kicks, I changed the permissions to 775 and 664. No go. – eisaacson Oct 15 '13 at 18:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.