Thursday, 9 July 2015

Shelter: Magento admin url redirecting to Wampserver page

I wanted to login to magento server admin panel using url: http://localhost/index.php/admin/ and it was bringing the wampserver page.

Solution
It look's like you have not set the good parameter for base_url. Go on your database -> 'core_config_data' -> 'base_url' -> 'value'
 
In 'path' row search web/unsecure/base_url and web/secure/base_url, then look the row 'value' for those path –  zaka47 Sep 15 '14 at 15:39

Magento/shop/index.php/admin login page was redirecting to login page again:
In the base_url use the server name rather than localhost. This is well known problem in Magento.
Resolved it. Had to change in the core_config_data table,
Path:                      value:
web/secure/base_url       http://servername.com/
web/unsecure/base_url     http://servername.com/
in database.


Login Redirect Issue with Magento on wampserver or localhost

NEED TO EDIT Many of us would have face the problem of login issue in magento localhost. Let me tell you how to avoid this.
Problem: After installing magento in localhost if you try to enter admin panel after logging in you will get the same login page again without  any reasons(messages).
Solution: When logging into magento admin panel it tries to validate the url whether it is a valid domain or not and if it is not a valid domain, it will erase cookies and come back to admin login page again. Obviously our url will be http://localhost/magento and it is not a valid domain. To overcome this we need to change certain code in a file called varien.php which is located in magento core folder.
Now Let’s see how to make it work by modifying the varien.php
Step 1: Copy varien.php file from app\code\core\Mage\Core\Model\Session\Abstract folder
Step2: Paste into app\code\local\Mage\Core\Model\Session\Abstract folder. Before you paste the file you need to create the folders as specified in this path such as \Mage\Core\Model\Session\Abstract.
Step3: Open varien.php in your favorite editor.
Step4: Find line no 96 and the code will be like

if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();

}
and replace with
if ((isset($cookieParams['domain'])) && !in_array("127.0.0.1", self::getValidatorData())) {
$cookieParams['domain'] = $cookie->getDomain();
}
Step5: That’s it. Now you will be able to login Magento admin panel.

How to enable mod_rewrite
To enable the mod_rewrite using the wampmanager menu system:

left click the wampmanager icon ( thats the W icon that sits in the system tray, usually bottom right of your screen )

wampmanager -> Apache -> Apache modules -> and click the line [rewrite_module] if it is not ticked
You may have to scroll the menu down to find rewrite_module


Alternatively you can manually edit the httpd.conf file

left click wampmanager -> Apache -> httpd.conf

This will open that file in notepad and you can locate the line
#LoadModule rewrite_module modules/mod_rewrite.so
and remove the comment symbol '#' to activate the module. Then save the file and restart Apache to activate this change.

No comments:

Post a Comment