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.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.