Magento的子页面给404

我只是在ubuntu上运行apache2的另一台服务器上恢复了我们的Magento网站。 主页拉起来很好,但如果我尝试去其他页面,我会得到一个404。

权限

  • 所有文件都是660
  • 所有目录都是770所有文件和目录
  • 所有文件和目录都属于www-data组

我试过的东西

  • 检查所有的网站和存储ID
  • 在域和页面path之间添加/index.php/
  • 清除临时文件

除access.log和error.log中的标准404行之外,日志文件中不会显示任何内容。

apache2 .conf文件

<VirtualHost *:80> ServerAdmin [email protected] ServerName mydomain.com DocumentRoot "/var/www/default/" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <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 </Directory> 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 </VirtualHost> 

的.htaccess

 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> <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> <IfModule mod_deflate.c> </IfModule> <IfModule mod_ssl.c> SSLOptions StdEnvVars </IfModule> <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] </IfModule> AddDefaultCharset Off <IfModule mod_expires.c> ExpiresDefault "access plus 1 year" </IfModule> Order allow,deny Allow from all <Files RELEASE_NOTES.txt> order allow,deny deny from all </Files> 

日志文件输出

 ==> /var/log/apache2/oem1-error.log <== [Tue Oct 15 12:32:21 2013] [error] [client 192.168.0.4] File does not exist: /var/www/gearhead_oem1/admin ==> /var/log/apache2/oem1-access.log <== 192.168.0.4 - - [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" 

听起来像重写的问题。 在Ubuntu中:

跑:

 a2enmod rewrite apt-get install php5-curl 

接着:

 service apache2 restart 

mod_rewritephp-curl现在将被启用!

PHP需要不同的权限。 Magentobuild议如下:

 find . -type d -exec chmod 775 "{}" \; find . -type f -exec chmod 664 "{}" \;