path not resolving to images

Discussion in 'Apache' started by bbxrider, Oct 15, 2007.

  1. #1
    running apache 2.2.4 on winxp pro
    running virtual hosts and trying to add a quick page for one site
    ie www.mydomain.com/quickpage.html
    the site works fine ie, www.mydomain1.com and i can load images on pages from multiple directories under the documentroot
    the 'quick page' comes up ok but can't get images to load no matter what
    path i use
    the virtual host code is
    <VirtualHost *:80>
    ServerAdmin myname@domain1.com
    DocumentRoot C:/apache2/htdocs/domain1
    DirectoryIndex index.html index.htm
    ServerName www.domain1.com
    ServerAlias domain1.com *.domain1.com
    ErrorLog C:/apache2/logs/www.domain1-error_log
    </VirtualHost>
    i created a dir for the quick page images......./domain1/qpage
    i have tried path statements all the way from
    <img src="c:/apache2/htdocs/domain1/qpage/img1.jpg"
    to
    <img src="qpage/img1.jpg"
    but nothing is resolving, it seems because i directly address the 'quickpage' it throws off the path resolution???
    bob
     
    bbxrider, Oct 15, 2007 IP
  2. ThreeGuineaWatch

    ThreeGuineaWatch Well-Known Member

    Messages:
    1,489
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    140
    #2
    Hi,

    I have never used Apache on Windoze, but isn't it supposed to be backslash ("\") in Windows world instead of the forward slash ("/") used in other environments?

    What are you seeing in the error log?
     
    ThreeGuineaWatch, Oct 17, 2007 IP
  3. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My guess is that the HTML is not correct. Try
    <img src="/qpage/img1.jpg" />
    Code (markup):
    The only difference between that and what you wrote above is the slash at the start of the img src.

    I remember the Apache-supplied httpd.conf has some instructions regarding slashes and backslashes in the conf files but I can't remember what those instructions were. I know that anywhere in html you should only use forward slashes.
     
    Ladadadada, Oct 18, 2007 IP