cancel
Showing results for 
Search instead for 
Did you mean: 

Error after Admin URL Change

Error after Admin URL Change

Hello,

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/oredium.com/public_html/vendor/magento/framework/App/Router/Base.php:182 Stack trace: #0 /var/www/oredium.com/public_html/vendor/magento/framework/App/Router/Base.php(182): explode() #1 /var/www/oredium.com/public_html/vendor/magento/framework/App/Router/Base.php(165): Magento\Framework\App\Router\Base->parseRequest() #2 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Router\Base->match() #3 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Backend\App\Router\Interceptor->___callParent() #4 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Backend\App\Router\Interceptor->Magento\Framework\Interception\{closure}() #5 /var/www/oredium.com/public_html/generated/code/Magento/Backend/App/Router/Interceptor.php(26): Magento\Backend\App\Router\Interceptor->___callPlugins() #6 /var/www/oredium.com/public_html/vendor/magento/framework/App/FrontController.php(115): Magento\Backend\App\Router\Interceptor->match() #7 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch() #8 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent() #9 /var/www/oredium.com/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() #10 /var/www/oredium.com/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins() #11 /var/www/oredium.com/public_html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch() #12 /var/www/oredium.com/public_html/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->launch() #13 /var/www/oredium.com/public_html/index.php(39): Magento\Framework\App\Bootstrap->run() #14 {main}
1 REPLY 1

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