Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento admin URL not working: 404 after changing it, can't go back

I've been looking through all the topics to find something similar to my case. I've found a few similar cases, but none of the solutions solved my problem.

I changed through the backend the admin url. After saving changes, magento took me directly to a 404 error. The new url I defined for the admin url was "gestion". Going to mydomain.com/gestion, gets a 404 error.

So I decided to go back deleting the new entries that were created on the magento core_config_data table and then emptied manually the cache directory.

But after that I've got the same error: 404 page not found. I've tried this and this. But still the same.

The weird thing is that I've deleted everything related to "gestion" on the database and also emptied the cache directory. But when I go to mydomain.com/admin, magento redirects my to mydomain.com/gestion (with a 404 error).

Why is magento redirecting me to "gestion" when I've removed everything related to that? Where else should I look to solve this?

P.D. Magento 1.5.1

like image 637
PauGNU Avatar asked Aug 26 '11 09:08

PauGNU


People also ask

Why Magento is not working?

To solve this issue, reset the permission role of your administrator from Admin Panel> Systems> Permission> User Roles. Follow the below steps: Select the role name that needs to be edited. Switch to the 'Role Resources' menu.

How do I find my Magento admin URL?

Default Admin URL and Path: http://yourdomain.com/magento/admin.


3 Answers

Here's the fix for the System Config Custom Admin URL booby trap. It's never worked, and probably never will. The only way to change it is to change the route through local.xml

https://magento.stackexchange.com/a/40622/553

And for anyone who turns Admin Base URL on, here's a way to kill it before you do anything else which WILL mess your system up.

Fire up phpMyAdmin and open your core_config_data table. You have four or more rows to edit.

Find admin/url/custom and set to 0

The next three will have been set from the funky Admin Base URL you set in the Admin Config panel. You know what it is, the following rows will have it in the value field. Note their config_ID numbers and write them down.

admin/url/custom and all instances of web/unsecure/base_url web/secure/base_url

Set these to be what your website unsecured base url should be. Example: http://yourwebsite.com/ and don't forget the folder followed by a slash if you installed there.

EDIT: Flush /var/cache and /var/session.

This should allow you to log into your Admin panel now by appending /admin to your website url as like before you got adventurous. Go to your Advanced Admin setup. Use Custom Admin will be set to No. Clear the URL from the Custom Admin URL field and save. When you go back and check your core_config_data table in phpMyAdmin, you should only find the admin/url/custom row still set to 0, the admin/url/custom row blanked, and the other two rows gone as they were deleted through the admin panel save.

The reason for doing it this way is that you need to get the right web/unsecure/base_url and web/secure/base_url rows deleted. If you get the wrong ones, your website frontend gets completely disabled instead of just losing the admin backend.

EDIT: Now that you have your website back up, go back and make sure you have the correct secure_base_url to get your TLS/SSL capabilities back.

This has all been tested on a dev server, YMMV

like image 147
Fiasco Labs Avatar answered Oct 24 '22 20:10

Fiasco Labs


ANSWER: I had the same issue and none of previous answers worked for me. I'm using Magento Version 1.9.

Here's what i did to fix the issue...

  1. Go to your cpanel and launch phpMyAdmin.
  2. Locate your Magento Database and select the core_config_data table.
  3. Locate and edit the following rows:
    • Scope:"Default" and Path:"admin/url/custom"
      • Select the NULL checkbox and save.
    • Scope:"Default" and Path:"admin/url/use_custom"
      • Change value from 1 to 0 and save.
    • Scope:"Default" and Path:"admin/url/use_custom_path"
      • Change value from 1 to 0 if it isn't already and save.
  4. Locate and delete the following rows:
    • Scope:"Stores" and Path:"web/secure/base_url"
    • Scope:"Stores" and Path:"web/unsecure/base_url" (should be located on the last page)
  5. Delete /var/cache folder

and you're DONE!

go to your previous admin url and it should work!

like image 21
Nxlevel Avatar answered Oct 24 '22 19:10

Nxlevel


After trying everything to fix the problem I found out that the /var directory didn't have the correct permissions. Magento wrote on /tmp so there was no effect emptying the /var/cache directory on the magento root.

We fixed the permissions and flushed the /tmp directory and everything went back to normal. So, it was the /var permissions that caused the problem.

Now we have another thing to take into account when something like this happens.

Thanks for your help, guys.

like image 1
PauGNU Avatar answered Oct 24 '22 20:10

PauGNU