Sunday, December 21, 2014

Magento Admin Login shows 404 error

The cause of this problem on an Apache web server

When every page on your website is showing you a 404 error screen, then most likely something has changed in your .htaccess file. The .htaccess file is responsible for masking your URI, so that you see one thing, while the server is being told something else. Additionally, your PHP files are designed to work with the masking, so they will continue to give you bad urls, while the disconnect is between Apache and PHP.


To confirm that this is the problem that you’re having, simply navigate around your website. If every link that you click on is a 404 error, then this is your problem.


Solution 1: Replace your htaccess file

You’ll need to fix your .htaccess file. You should first attempt to locate a version of the .htaccess file that existed prior to this error appearing. If you cannot locate an older copy of the file, then I’ve provided you with a fresh .htaccess file from a v1.9.0.4 Magento Installation. This file should work just fine, no matter which version of Magento that you’re running.


https://gist.github.com/Jonathonbyrd/3afd9f221b3b83dc6be9.js


Solution 2: Magento in a subdirectory

If you’re running Magento in a subdirectory, then the above solution is still required. Once you have a copy of an .htaccess file that you know is stable and will work for most installations, then you can go to work customizing it for your situation.


This solution is required if Magento is running in a subdirectory, but you don’t want that subdirectory to be visible in your urls. You will need to uncomment line 131 from the .htaccess file above. Of course, if Magento exists in a subdirectory with another name, then it will need to state the name of your subdirectory instead of “magento”.


Solution 2: Enable mod_rewrite

If you’ve attempted the solutions above and Magento is still showing 404 error pages, then delete the /var/cache directory.


If you’re still having the problem, then you will need to check and see if mod_rewrite is running on your server. To do this, rename your current .htaccess file and add the .htaccess file below. Once installed, navigate to /testing_mod_rewrite.html on your domain. If your website does not redirect you, then mod_rewrite is disabled and you will need to enable it.


https://gist.github.com/Jonathonbyrd/4690c58f36613ba040f0.js


To enable mod_rewrite, open the httpd.conf file in your Apache configuration directory. Make sure that the following line is active and not commented out.


LoadModule rewrite_module modules/mod_rewrite.so


Restart your Apache web server and test to see if mod_rewrite is enabled.



Magento Admin Login shows 404 error

No comments:

Post a Comment