• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

DNS configuration

foulquesd

New Pleskian
Hi there,

I got a problem with my DNS configuration, not a big one as my website works. But i'd like to redirect the normal url of my website (that's to say mydomain.com) to the one with www (www.mydomain.com). Unfortunately my knowledge in DNS and server administration is not enough to do that.
So if you have any idea how i could do that, i would be pleased to hear (or read in this case) it.

Thank you for your time.
 
Hello foolguesd,

I would recommend you to do a .htaccess file with the following rewrite rule

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
 
Thank you Thomas.
At first I doubted the solution cause I use kind of the same thing to do url rewriting and it doesn't really redirect the user. But it works and that prooves that i got a lot to learn in that domain.
 
and if your website is written in php then this small code can also do the same:

Code:
if (!preg_match('/www\..*?/', $_SERVER['HTTP_HOST'])) { 
    if(!EMPTY($_SERVER['QUERY_STRING'])) 
        header("location: http://www." . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']); 
    else 
            header("location: http://www." . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); 
}

You just put it ontop of your index file or so ...
 
Back
Top