root path problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nutz

    root path problem

    Hi, can anyone quickly solve this little problem please?
    I need to reference my $phpbb_root_pat h but none of the examples
    offered work because I'm using a subdomain. My phpbb is at root level,
    e.g. mydomain.com/ and the page I want to execute a call from is at
    newpages.mydoma in.com/
    Rather than try to work through the ../../ hierarchies I thought I'd
    instead give a fixed URL reference for it, but that doesn't seem to
    work either -
    <?php
    $phpbb_root_pat h = 'http://www.mydomain.co m';
    gives me the error "$phpbb_root_pa th is wrong and does not point to
    your forum."

  • Steve Belanger

    #2
    Re: root path problem

    you would need to find the real path of your root directory while on the
    main domain, and then use it while on the subdomain


    ie, on root it might be something like (use $_SERVER['DOCUMENT_ROOT'] to get
    the value)

    /var/home/websitename/public_html/

    just use that document root you get from the main domain and it should work.

    hope this helps

    "nutz" <mike-dean@ntlworld.c omwrote in message
    news:1172842857 .513889.176370@ z35g2000cwz.goo glegroups.com.. .
    Hi, can anyone quickly solve this little problem please?
    I need to reference my $phpbb_root_pat h but none of the examples
    offered work because I'm using a subdomain. My phpbb is at root level,
    e.g. mydomain.com/ and the page I want to execute a call from is at
    newpages.mydoma in.com/
    Rather than try to work through the ../../ hierarchies I thought I'd
    instead give a fixed URL reference for it, but that doesn't seem to
    work either -
    <?php
    $phpbb_root_pat h = 'http://www.mydomain.co m';
    gives me the error "$phpbb_root_pa th is wrong and does not point to
    your forum."
    >

    Comment

    • Jerry Stuckle

      #3
      Re: root path problem

      nutz wrote:
      Hi, can anyone quickly solve this little problem please?
      I need to reference my $phpbb_root_pat h but none of the examples
      offered work because I'm using a subdomain. My phpbb is at root level,
      e.g. mydomain.com/ and the page I want to execute a call from is at
      newpages.mydoma in.com/
      Rather than try to work through the ../../ hierarchies I thought I'd
      instead give a fixed URL reference for it, but that doesn't seem to
      work either -
      <?php
      $phpbb_root_pat h = 'http://www.mydomain.co m';
      gives me the error "$phpbb_root_pa th is wrong and does not point to
      your forum."
      >
      I'm not clear exactly what you're trying to do. What kind of call are
      you trying to make?

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Jim Carlock

        #4
        Re: root path problem

        nutz wrote:
        : I need to reference my $phpbb_root_pat h but none of the examples
        : offered work because I'm using a subdomain. My phpbb is at root level,
        : e.g. mydomain.com/ and the page I want to execute a call from is at
        : newpages.mydoma in.com/
        :
        : Rather than try to work through the ../../ hierarchies I thought I'd
        : instead give a fixed URL reference for it, but that doesn't seem to
        : work either -
        :
        : $phpbb_root_pat h = 'http://www.mydomain.co m';
        :
        : gives me the error "$phpbb_root_pa th is wrong and does not point
        : to your forum."

        Sounds like $phpbb_root_pat h is a variable from a pre-built forum
        configuration.

        Perhaps the best way to handle this is something along the lines of
        adding some code to redirect to the subdomain (if someone tries to
        go to http://www.example.com/myforum/) then set that variable to
        the subdomain name.

        <?php
        $sValidServerNa me = "subdomain.exam ple.com";
        $sServerName = $_SERVER['SERVER_NAME'];

        if ($sServerName !== $sValidServerNa me) {
        header("Locatio n: http://subdomain.examp le.com/");
        exit;
        }
        $phpbb_root_pat h = "http://subdomain.examp le.com/";
        ?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        ....

        That's the best interpretation pondered here.

        --
        Jim Carlock
        Post replies to the group.


        Comment

        Working...