How to use Drupal on a Temporary URL (Hosting)

If you move or create a Drupal site when the domain is not yet available/propagated you have to modify some Drupal settings to make your website work. This short howto shows you how you can do so with some simple edits.

Source: This article was written based on the GreenGeeks specifig article https://kb.greengeeks.com/2559/using-drupal-on-a-temporary-url/

Step 1: 
Edit settings.php

You find this file in the folder /sites/default of your Drupal installation. Navigate to the portion of the file that talks about the base URL. Pictured below is the adjustments that have to be made. Remove the # before the #base_url line and put in your temporary URL which could be something like http://IPADDRESS/~cpanelusername. Save the file.

Drupal8: $settings['file_public_base_url'] = 'http://IPADDRESS/~cpanelusername/sites/default/files';

Step 2: 
Edit the .htaccess file

Navigate to your drupal directory and open up the .htaccess file to edit just as you did for the settings.php. Place the following line in the file and hit save:

RewriteBase /~cpanelusername (using the link after the IP Adress, see in the above EXAMPLE)

Save the file.

Your Drupal installation will not work perfectly with the temporary URL. Be sure to undo these changes when you point the domain to your ISP.

Taxonomy: 

Drupal themes to be compared