This article describes how to change the absolute path (base URL) in Drupal 8 and 9.
In Drupal 7 and earlier versions, you could change the base URL by modifying the $base_url variable in the Sites/Default/Settings.php file. In Drupal 8 and later versions, however, the $base_url setting is deprecated and no longer used.
However, you can update the base URL directly in the Drupal database. The following steps demonstrate how to do this.
First, export the current Drupal database to a file and download the file to your local computer.
After you have a file of the exported Drupal database, you are ready to make the changes to the base URL. To do this, follow these steps:
Next, upload to your hosting account the database file that you modified in step 2, and then import it into the Drupal database.
View the Drupal site in your web browser and make sure everything works as expected.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.