Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why is Subdomain effecting html/css code?

    Hi there,

    Im trying to set up a sub domain. i have created a page with its own folder and it works fine for me offline then when i access it online the images will not display.

    stranger again if i access it http://www.galwayartworks.com/store/winnie/ the page is fine

    the subdomain with the problem is http://winnie.galwayartworks.com/

    how can the same html page in the same folder act different cause its accessing from a different place?

    i have tried lots of messing around with the code and this is my last resort

    Thanks for any help or comments in advance.

    Luke

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Is the css in a seperate .css file or all determined in the <head> </head> tags?

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is some in the head and some in a separate file.

    this is one of the images that is not displaying

    <td style="background-image:URL(d/header_bg.gif); background-repeat:repeat-x;" bgcolor="#52B6DE">

    Thanks for reply
    Luke

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    Make sure you copy the .css file to the same directory in the subdomain.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    The sub domain will affect how relative links work. The sub domain is considered a separate site so the root of the sub domain will be /.
    OracleGuy

  • #6
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow thanks oracleguy that solved my problem straight away. what a great forum only came across it tonight. was thinking i might get an answer tomorrow if im lucky!! thanks rafiki for your response too.

    Thanks again guys
    Luke

  • #7
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oracleguy View Post
    The sub domain will affect how relative links work. The sub domain is considered a separate site so the root of the sub domain will be /.
    Thanks

  • #8
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im back, i changed the code so the files are linked to directly and it seemed to work for me last night.

    <td style="background-image:URL(http://www.galwayartworks.com/store/...eader_bg.gif); background-repeat:repeat-x;" bgcolor="#52B6DE">

    But when i went back to it today its not showing the images?

    Im so confused how can it work it when you go to the page location without the subdomain

    http://www.galwayartworks.com/store/winnie/

    and then when you go to it this way it shows you the page but the images will not load.

    http://winniethepooh.galwayartworks.com/

    Is it bad code im using i just cant understand it.

    Thanks again for helping me.

    Luke

  • #9
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's something funny about subdomains and css/images that nobody seems to have touched on yet. I've never been able to get any css code to work from an external stylesheet in a url which is on a subdomain, despite the fact the link in the html header is valid (entering it as the URL just downloads the stylesheet). And moving the same code to the main site works fine.

    I would be grateful if anyone has any thoughts, and I will keep this forum in my bookmarks for when I solve this problem, because I have a feeling it is related to what lukeee is describing here.

    I am hosted on a Ubuntu Apache server hosted by 1and1.

  • #10
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Silly me! Please ignore my last post. The problem I was having was because the images URLS in the css were on higher levels of the directory than the root of the subdomain (which was one folder in from the actual www root and of course it couldn't access it. Even though the css file url was still correct relative to the root of the subdomain.

    The other problems I've been having from other software I installed were caused by the same problem, absolute links which (of course) are now different.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •