How to make website accessible on www or non-www in Plesk

Follow

Comments

2 comments

  • Avatar
    Marco Marsala

    Setting Preferred domain prevents loopback connections in PHP scripts from working.

    The following code on domain.com works as expected only if setting Preferred domain = None, otherwise it returns a cURL error: Failed to connect to domain.it port 80: Connection refused 

    <?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://domain.com/');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_exec($ch);
    echo curl_error($ch);
    ?>


    dd

    0
    Comment actions Permalink
  • Avatar
    Mariusz

    hello, how make forwarding for subdomains?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request