Like many PHP based Content Managment 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 Fantastico 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

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.

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)"

drupal-temp-url-file-manager

Next, navigate to the sites/default/settings.php file. Make sure you have the settings.php file selected (not the default.settings.php file).

Select either Edit or Code Editor to open the settings.php file for editing.

drupal-temp-url-settings

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.

drupal-temp-url-base-url

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!

Click the Save Changes button and then close the file (Close button).

Edit the .htaccess file to use Drupal through the temporary URL

Next, we will need to edit the .htaccess file for your site.

Navigate back to the document root directory for your site (public_html for main domain or public_html/addondomain.com).

Select your .htaccess file and click either Edit or Code Editor to open the file for editing.

drupal-temp-url-htaccess

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

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:

Change the $base_url value in settings.php back to your domain name:

$base_url = 'http://yourdomain.com'

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?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

I'm Christi Nickerson, your friendly Community Support technician, and I wrote the article you're looking at now. I like to think it's perfect, but I'm sure you have some suggestions. Please, let me know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Site under brute force attack
  2. URLs in Installation of WordPress Don't Redirect
  3. Choosing a Directory With WordPress

Support 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.