Showing results for 
Search instead for 
Did you mean: 

Error after Admin URL Change

Error after Admin URL Change


I have changed admin URL using below command after that I got below error and admin url is showing 404 error.


php bin/magento setup:config:set --backend-frontname="admin123"

Here is the error after URL change on frontend

TypeError: explode() expects parameter 2 to be string, null given in /var/www/ Stack trace: #0 /var/www/ explode() #1 /var/www/ Magento\Framework\App\Router\Base->parseRequest() #2 /var/www/ Magento\Framework\App\Router\Base->match() #3 /var/www/ Magento\Backend\App\Router\Interceptor->___callParent() #4 /var/www/ Magento\Backend\App\Router\Interceptor->Magento\Framework\Interception\{closure}() #5 /var/www/ Magento\Backend\App\Router\Interceptor->___callPlugins() #6 /var/www/ Magento\Backend\App\Router\Interceptor->match() #7 /var/www/ Magento\Framework\App\FrontController->dispatch() #8 /var/www/ Magento\Framework\App\FrontController\Interceptor->___callParent() #9 /var/www/ Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() #10 /var/www/ Magento\Framework\App\FrontController\Interceptor->___callPlugins() #11 /var/www/ Magento\Framework\App\FrontController\Interceptor->dispatch() #12 /var/www/ Magento\Framework\App\Http->launch() #13 /var/www/ Magento\Framework\App\Bootstrap->run() #14 {main}

Re: Error after Admin URL Change

Hello @ishaqdahot 


The error message you encountered indicates that there is an issue with the Admin URL after it has been changed in Magento 2. Here are a few steps you can take to resolve the error:

  • Clear the cache:
    • Run the following command from the Magento root directory to clear the cache:
      • php bin/magento cache:clean
  • Update the base URLs:
    • In your Magento database, locate the core_config_data table. Look for the rows with the paths web/unsecure/base_url and web/secure/base_url. Update the values of these rows to reflect the new Admin URL. Make sure the URLs are complete, including the protocol (e.g., http:// or https://).
  • Flush Redis or Memcached (if applicable):
    • If you're using Redis or Memcached for caching, you may need to flush the cache specific to these services. Refer to the Redis or Memcached documentation for the appropriate commands.
  • Update the cookie domain (if necessary):
    • In the core_config_data table, look for the row with the path web/cookie/cookie_domain. If the value is set, make sure it matches the new Admin URL. If it doesn't match, update it accordingly or set it to an empty value.
  • Verify file permissions:
    • Ensure that the file and folder permissions are correctly set for your Magento installation. You can refer to the Magento documentation for the recommended file permissions.
  • Restart the web server:
    • Restart the web server to ensure all changes and configurations are properly applied.

If you find our reply helpful, please give us kudos.


A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.


WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Thank You,

WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

Location: 150 King St. W. Toronto, ON M5H 1J9