cancel
Showing results for 
Search instead for 
Did you mean: 

Admin url changes domain & gives 404 error on multisite Magento 2.3.4

Admin url changes domain & gives 404 error on multisite Magento 2.3.4

After moving to new a server the admin url gives 404 error on multisite Magento 2.3.4 ,with domains new.example.com and new.20example.com

  • The frontend works perfectly for both sites

  • When I go to the admin path using new.example.com I get 404 error with or without index.php in the url.

  • If I change the domain part of the url to the new.20example.com it changes the domain part to new.example.com but includes the additional path that usually gets tacked on i.e. admin/index/index/key/(alphanumeric code)
    This also gives a 404 error. If I can force it to maintain new.20example.com in the url it should connect.

Any suggestions would be greatly appreciated.

I have done the following:

  • SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0
  • in ssh cleaned cash, reindexed and upgrade
  • I don't have access to the root of this shared server to sudo
3 REPLIES 3

Re: Admin url changes domain & gives 404 error on multisite Magento 2.3.4

It really looks great, I've seen many other posts, that's the info I needed, thanks for sharing. 

 word finder

Re: Admin url changes domain & gives 404 error on multisite Magento 2.3.4

Every find a solution? We're experiencing the same problem.

Re: Admin url changes domain & gives 404 error on multisite Magento 2.3.4

Hello theawesome10e8,

 

It is a common error that Magento users face after installing their Magento site, even if the installation is successful: 404 Not Found on the multi-site admin page. The error usually occurs after moving to a new server or installing & upgrading extensions.

 

You can follow the below steps to fix the Admin 404 error on your site,

 

Re-check your admin URL in env.php:

 

The error can appear If you have mistyped your admin URL. First, ensure that you have the admin URL correct, 

 

  • Navigate to [..]/app/etc/ and open the env.php file.
  • Now, with admin as our frontName, our admin url will be http://magento-website.com/admin.
  • Lastly, If the admin URL is not correct, then update the URL.

 

Flush Magento cache:

 

  • Firstly, flush the Magento cache using the following commands,

 

php bin/magento cache:clean
rm -rf var/cache/*
rm -rf var/generation/*

 

  • Thus, it helps your site run faster and clears the cache to apply the latest changes.

 

Add/replace .htaccess file in the root folder:

 

  • Add/restore the default .htaccess file in the root folder with the official .htaccess file from the Magento code base to fix the issue.

 

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/pub/
RewriteCond %{REQUEST_URI} !^/setup/
RewriteCond %{REQUEST_URI} !^/update/
RewriteCond %{REQUEST_URI} !^/dev/
RewriteRule .* /pub/$0 [L]
DirectoryIndex index.php

 

  • You can Add/replace the above .htaccess file in the root folder.

 

Delete var/cache folder:

 

  • Firstly, delete the var/cache folder.
  • Then, navigate to your Magento 2 database and run the following SQL query:

SELECT * FROM core_config_data When path = 'web/seo/use_rewrites'

  • Now, change the value of web/seo/url_rewrites to 0
  • Lastly, try to access your Magento Admin through the below URL:

https://your_magent_base_url/index.php/your_admin_url/

 

Thus, you should try the steps mentioned above to fix the issue of your Magento site. I hope the above methods help you to resolve the error.

 

-------------------------

Regards,

Rex M

AccuWeb Hosting | Magento Hosting