A site's been developed on localhost and I want to move it to my new hosting, which uses Plesk. This hosting doesn't have DNS pointing to it, although the domain is added. (The domain name is currently pointing to my old hosting.)

I have changed $base_url to the preview URL Plesk provides:

$base_url = 'https://the-url-pleskprovides:8443/sitepreview/http/myurl.com';

I can access the site and even browse, but I can't login because login redirects to https://the-url-pleskprovides:8443/user instead of https://the-url-pleskprovides:8443/sitepreview/http/myurl.com/admin/.

Is there any way to work with Plesk preview, or with Drupal without a domain?

Any help will be highly appreciated.

3 Answers 3


Ok, the answer is unfortunately Drupal can not handle this situation. What should be done is the following:

On Windows

Go to: C:\Windows\System32\drivers\etc

Open: hosts file

Add at the end: yourdomainname.com www.yourdomainname.com

On Mac

Open Terminal (Applications -> Utilities -> Terminal)

Open hosts file: $ sudo nano /private/etc/hosts

Type your user password when prompted

Add at the end: yourdomainname.com www.yourdomainname.com

Save the file Flush the DNS cache: $ dscacheutil -flushcache

NOTE: The IP is the IP of your server. You can get it by logging into Plesk, Home>System Overview


One feature that Plesk 10 and 11 support is the use of a proper preview domain (which is a proper ServerAlias in Apache which Drupal will like) but it needs to be setup by the server sysadmin. It isn't something that a regular shared hosting account has access to change. In the control panel it's referred to as 'Quick Preview' see the manual.

If it is setup every site on the machine will get a hostname similar to:

domaininplesk.com.[plesk server ip].externaldomain.com

where [plesk server ip] is the ip assigned to the hosting account with the dots replaced with dashes e.g. 127-0-0-1.


I would do the following if I was in your shoes: Put a temporary entry in your robots.txt file so it won't get crawled. You can also add something in your /index.php; check $_SERVER['HTTP_HOST'] to see if it's the temporary one or not.

Basically, just run the site from the temporary plesk domain until you're ready; then, change the settings file.

  • How does this help with the login redirect? It is not a matter of the URL being crawled from search engines, but the redirection using the wrong URL.
    – avpaderno
    Commented Aug 21, 2012 at 14:29
  • it will eliminate the need to "fix" the redirect. in my opinion, trying to fix something that is caused by Doing It Wrong is a bad idea. better to take a step back and see if what you're chasing is even a problem to begin with. if it was done the way I described it, the problem wouldn't exist.
    – jdu
    Commented Aug 21, 2012 at 17:31
  • Hi @jdu ,thanks, but I don't think robots.txt has something to do with it. The problem is that drupal doesn't recognize the /sitepreview/http/myurl.com part of $base_url correctly Commented Aug 21, 2012 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.