
Dutch
Het probleem
Na het upgraden van Magento naar versie 1.4.0.1 was er een klein probleem met het doorsturen naar de startpagina in de backoffice.
Na iedere keer inloggen resulteerde dit in een 404 pagina.
Omdat ik het niet in elke webshop had, ben ik opzoek gegaan naar het probleem.
Het probleem is het toevoegen van de winkelcode aan de URL, bij een meertalige webshop is dit voor SEO een must zodat je bijvoorbeeld URL’s als www.voorbeeldschop.nl/nl/categorie/product.html krijgt. Hierdoor kan je unieke URL’s per land uitserveren.
Echter worden deze codes ook in het admin gedeelte (de backoffice) gebruikt, standaard is hier de ’storecode’ admin.
Omdat het backoffice standaard is te benaderen via www.voorbeeldschop.nl/admin en hier nog de storecode aan moet worden toegevoegd, krijg je feitelijk dus www.voorbeeldschop.nl/admin/admin/.
De oplossing
Omdat in het inlog formulier geen HTML action staat, zal het formulier de huidige URL gebruiken, als u de backoffice dus benaderd zonder extra storecode, maar wel deze instelling aan heeft staan, (dit is trouwens hier in te stellen: System->Configuration->General->Store Code to URLs), zal het formulier naar de verkeerde URL gaan, namelijk de versie zonder store code.
Wil je wel de backoffice kunnen benaderen zonder www.voorbeelshop.nl/admin/admin te moeten gebruiken, pas dan het volgende aan:
app/design/adminhtml/{theme}/{template}/template/login.phtml on linenumber 48
<form method="post" action="" id="loginForm">
Vervang met:
<form method="post" action="http://<?php echo $_SERVER['HTTP_HOST']; ?>/admin/admin/" id="loginForm">
Let op
Gebruikt u een aangepaste admin-URL dan doet u deze op te geven i.p.v. ‘admin’.
English
The problem
After upgrading to 1.4.0.1 Magento we had a 404 after each login action.
Because I do not have this issue by any shop, I started looking for a solution.
The problem is due to the “Add Store Code to URL” setting.
It adds the storecode to the URL.
This storecode is also expected in the admin area.
By default, the login form called via (domain) / admin and no action on the form is passed, thus there is no known storecode.
The solution
Als je het inlogformulier aanroep via {domein}/admin/admin zal het werken.
If you also want (domain) / admin work, change the following:
app/design/adminhtml/{theme}/{template}/template/login.phtml on linenumber 48
<form method="post" action="" id="loginForm">
Replace with:
<form method="post" action="http://<?php echo $_SERVER['HTTP_HOST']; ?>/admin/admin/" id="loginForm">
Helemaal goed, dank voor de uitleg!
Thanks!
But I rather prefer the following line as some setups might be in subfolders:
<form method="post" action="admin/” id=”loginForm”>
Your solution assumes that Magento installations are in the root.
phpTag echo Mage::getBaseUrl() ?>admin/
True, my solution assumes that Magento is installed in the root.
You solution is a more generic.
Works for me – thanks!
I used this in the action:
< ? getUrl('adminhtml'); ?>
Not sure if it makes any difference though.
In any case – helpful post.