NOTE: As of Drupal 7.27 no changes are necessary in order to use the Temp URL. These instructions are for older Drupal versions.

Like many PHP based Content Management Systems (CMS), Drupal depends on a working domain name. If you have a domain name that is not pointed to our Nameservers and you're not ready to point it at this time, you can install Drupal and test it through your Temporary URL with just a couple of changes.

First, let's see what happens to our Drupal site if we've installed it through Softaculous and try to view it through our temporary URL:

drupal-temp-url-before

As you can see, it doesn't look like a normal Drupal installation. Additionally, if we try to log into the Drupal admin interface we receive a 404 error.

drupal-temp-url-404

Editing the Drupal settings.php File

  1. The first step in resolving this will be to log into cPanel where we will access the cPanel File Manager and edit our Drupal settings file.
  2. Once you are logged into cPanel, click on the File Manager icon. Make sure you select the correct document root for site (Document Root For:) and select "Show Hidden Files (dotfiles)".
  3. Next, navigate to the sites/default/settings.php file. Make sure you have the settings.php file selected (not the default.settings.php file).
  4. Select either Edit or Code Editor to open the settings.php file for editing.
  5. Either scroll down or do a search for the line that begins with $base_url. Note, there are several lines above this that provide examples of base_url, please make sure you are on the correct line.
  6. Replace the value for the $base_url with your temporary URL. For your main domain name, your temporary URL will be similar to this:

    http://whub21.webhostinghub.com/~userna5

    If you are working with an Addon domain, your temporary URL will be similar to this:

    http://whub21.webhostinghub.com/~userna5/addondomain.com

    When you've finished replacing the $base_url value, this line will look like one of these two examples:

    Main domain name:
    $base_url = 'http://whub21.webhostinghub.com/~userna5';  // NO trailing slash!

    Addon domain:
    $base_url = 'http://whub21.webhostinghub.com/~userna5/addondomain.com';  // NO trailing slash!
  7. Click the Save Changes button and then close the file (Close button).

Editing the .htaccess file

  1. Log into your cPanel.
  2. Next, click on the File Manager icon found under the Files category. Make sure you select the correct document root for site (Document Root For:) and select "Show Hidden Files (dotfiles)".
  3. Navigate back to the document root directory for your site (public_html for main domain or public_html/addondomain.com) and select your .htaccess file and click either Edit or Code Editor to open the file for editing.
  4. Scroll down or do a search for this line:
    # RewriteBase /drupal
    Delete the # sign and space just after that symbol to un-comment the line and change /drupal as follows for either your main domain or an Addon domain:

    Main domain:

    RewriteBase /~userna5

    Addon domain:

    RewriteBase /~userna5/addondomain.com
  5. Click the Save Changes button and close the file (Close button).

Now when you bring up your Drupal site through your temporary URL, the site appears correctly and you can log into your Drupal admin interface.

drupal-temp-url-after

drupal-temp-url-admin

Once you have pointed your domain to our Nameservers and allowed 4-24 hours for DNS to propagate, you can disable the changes made above.

If you have any questions about these changes or need any assistance, please feel free to submit a question to our Support Center.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}