How to Access Drupal from a temporary URL?
Before publishing a web site over the web, we have a tendency to make sure that everything over the web site is simply however we expected. In such a case having to access our Drupal based web site on a cPanel server with a temporary URL will come-in handy.
For example:
http://yourserverip/~username/your-test-website
Following the steps below should help you set-up a site over a temporary URL:
Step 1: Find the file /public_html/sites/default/settings.php on the server.
Step 2: Find the setting “$base_url = “.
Un-comment the line and replace with the below:
$base_url = 'http://serverip/~test';
Step 3: You must now configure the .htaccess for appropriate redirection.
Step 4: Open .htaccess file in the drupal directory. (/public_html/your-test-website/.htaccess)
Find the line which says ‘RewriteBase /‘
Un-comment the line and replace it with the following:
RewriteBase /~username
Step 5: Save the file.
Now try accessing your domain using the temporary URL:
http://yourserverip/~username/your-test-website
By doing this, you’ll check your web site without publishing over the internet. Once you’re assured concerning its functionality, you will move the complete directory below the main domain to make the site publically accessible.