The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question about Subdomains and Linking images from outside folders

Discussion in 'General Discussion' started by noimad1, Nov 30, 2004.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I have a user that set up a subdomain, lets say:

    http://bob.hisdomain.com

    which of course automatically creates the folder in http://hisdomain.com/bob

    The customer has uploaded an index file to the bob folder, however, he is using relative paths instead of URL paths in his links and images that are above his subdomain folder. For example he is trying to do this:

    PHP:
    <img src "../images/bob.jpg">

    instead of
    <img src "http://hisdomain.com/images/bob.jpg">
    now, if he goes to http://bob.hisdomain.com the picture doesn't show up. But if he goes to http://hisdomain.com/bob it does show up.

    I guess my question is, if he is using it as a subdomain, does it run as a different user or something that would now allow the subdomain to access folders above its own folder?
     
  2. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    The sub-domain has it's own web directory, so when calling the image using ../images, it will look for the folder /bob/images, since bob is the root web directory.
     
  3. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    So there is no way to get images from any directories above bob other than using the full URL in the tag?
     
  4. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    <Bump> anyone?
     
  5. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    NO. You could call the file using the absolute location with PHP. Your server may not allow this though.
     
Loading...

Share This Page