在magento1系统开发时。我们往往会进行代码的迁移,备份等操作,magento1代码的迁移常常注意的一下问题。
1.如果迁移后apache服务器上出现了只能访问首页或者只能访问index.php,就说明magento文件系统里面的.htaccess文件没有起作用。
解决办法:是新的服务器没有在httpd.cnf里面默认没有开启 htaccess文件的功能,搜索AllowOverride把值改为All即可
即使在apache服务器配置文件/etc/httpd/conf/httpd.conf里面找到:AllowOverride的值给为如下代码即可
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # # Options Indexes FollowSymLinks Options FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> |
执行下列命令检查语法是否正确:
1 | httpd -t |
在执行下列命令,重新加载apache配置文件:
1 | systemctl reload httpd |
最后刷新网页显示ok。