SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict
    Join Date
    May 2000
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have my site up and running on my host and I am using SSI calls for all my nav bars.

    I have a direct copy of the site on my HD where I do my work (like typing an article before I upload it).

    Now when I am doing my work here on my PC and lets say I am building an article that includes pictures. I will build the article, with pictures in the same folder, and then open the page in my browser (again, working offline). The browser wont show the pictures because it is trying to look at my directory online in my hosts server...

    So basically, when I open a page in my HD trying to work offline, it actually connects to the server and downloads all my banner ads.

    why is this?

  2. #2
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Eugene, OR
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use <img src="http://www.yoursite.com/your_image.gif"> , this is an absolute path and will look for the image at that location.

    If you use <img scr="your_image.gif"> , this is a relative path, and will look for the image relative to the document that is being loaded. So if you open the page locally, it will look for the image in the same directory as the file being opened. If you open the page on the web, it will look in the same directory on the web server as the file being loaded.

    Is this what you are asking?

    Adam

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes thats sort of my problem... Except I am not using "http://www.mysite.com/img.gif" I am using "/images/mygif.gif"

    does that work the same?


  4. #4
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have to wonder if using SSI is necessary for what you want to do?

    As Adam explained:
    absolute path = any link starting with http://
    relative path = any link starting without it

    When working on Windows and using a relative path, you must use " ../ " for links to work/show correctly. The PITA part is if your images dir is at the top, and you're 6 levels down. Then you have to use " ../ " 6 times for all image links. When working on or changing HTML files, this can be quite confusing.

    I don't know how it works on an NT Server (probably the same as above) but on a Unix/Linux system using a link just the way you have it ( /images/mygif.gif ) means that if you link is 6 levels down, it will still work properly. Can someone correct me on this if I'm wrong. My experience has always been with Unix/Linux using Apache, so I'm not sure if it's the *nx system or Apache that allows this.

    Using it the way you have it, does not require SSI. That is the point I was trying to make. Windows does not operate the same as a Server and the links have to be structured differently. The image not showing on your page on your computer, is because of Windows, but as soon as you upload it to the Server it will work properly.

  5. #5
    SitePoint Addict
    Join Date
    May 2000
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, using SSI isnt a MUST for the site. But then again, is it ever REALLY a must?

    as the site is now it isnt real big to go in and hand change my nav bars one by one should I want to add/remove a section, but im planning for the future. What happens when I have 50 or even 100 pages... I really dont want to have to copy and paste a new section into my nav bars 50 to 100 times then have to upload 50 to 100 pages when I could simply change my SSI page and upload it then move o n to my next task.


  6. #6
    SitePoint Wizard
    Join Date
    Sep 1999
    Posts
    1,390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use a find and replace program to change navbars in many files instantly. I like using BK Replace Em or TextPad to do this.

    You still have to upload all the changed files.

  7. #7
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you say are valid points, but you don't mention if my post helped to clear up the question you had asked:

    Except I am not using "http://www.mysite.com/img.gif" I am using "/images/mygif.gif"
    does that work the same?

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't know how it works on an NT Server (probably the same as above) but on a Unix/Linux system using a link just the way you have it ( /images/mygif.gif ) means that if you link is 6 levels down, it will still work properly. Can someone correct me on this if I'm wrong. My experience has always been with Unix/Linux using Apache, so I'm not sure if it's the *nx system or Apache that allows this.

    Using it the way you have it, does not require SSI. That is the point I was trying to make. Windows does not operate the same as a Server and the links have to be structured differently. The image not showing on your page on your computer, is because of Windows, but as soon as you upload it to the Server it will work properly.
    As far as a Web Server on Windows is concerned it treats files the same as the webserver on Unix or Apache under the HTTP protocol. Meaning if you images is off the root by one directory, using "/images/imgname.gif" will work just fine. There is no need to use ../ 6 times if your 6 levels deep though it would work, just like it would work on a Unix/Linux machine. This won't work on your Windows machine if you go through the file system. Just like it won't work on a Unix/Linux machine if you go through the file system.

    The easiest thing to do is install a webserver on your local machine to do the testing. All the best webservers are free so there is no cost, you can choose from Apache, PWS, IIS or Sambar on the windows platform. You just can't use IIS on a Win9X machine. Once you have a webserver set up you can access your site by putting it in the webroot folder (c:/Apache/htdocs for Apache, C:/inetpub for PWS or C:/wwwroot for IIS) and opening your browser. Once in the browser navigate to site 127.0.0.1 which will always be your local machine. Then you can test you site locally just like it would operate on your host. You can even install things like PHP and MySQL if you so desire.
    Wayne Luke
    ------------


  9. #9
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was no mention of a Webserver being used on the local machine, jizbot is using. For that matter, we don't even what system is being used. Using " ../ " on any Windows 9x system is a must, if the image is below the top dir and you want the picture to show. Unless of course, the file is in the same dir as the images folder it is referring to.

    Using just the slash does not work on Windows 9x! It must be used as " ../images/mygif.gif " and one set of " ../ " used for each level you want to go up, or not used at all (i.e. " images/mygif.gif ").

  10. #10
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There was no mention of a Webserver being used on the local machine, jizbot is using. For that matter, we don't even what system is being used. Using " ../ " on any Windows 9x system is a must, if the image is below the top dir and you want the picture to show. Unless of course, the file is in the same dir as the images folder it is referring to.

    Using just the slash does not work on Windows 9x! It must be used as " ../images/mygif.gif " and one set of " ../ " used for each level you want to go up, or not used at all (i.e. " images/mygif.gif ").
    It may be a must on your machine but I use "/images/imagename.gif" on my Windows machine in both the file system and within PWS and both work great. I do have my website directory substituted as a Drive though which is why it works in the file system.

    Code:
    SUBST [drive1: [drive2:]path]
    SUBST drive1: /D
    
      drive1:        Specifies a virtual drive to which you want to assign a path.
      [drive2:]path  Specifies a physical drive and path you want to assign to
                     a virtual drive.
      /D             Deletes a substituted (virtual) drive.
    
    Type SUBST with no parameters to display a list of current virtual drives.
    I was suggesting he install a webserver on his machine. It would be a real pain to use "../../../../../" and have to change it to "/images/" every time you wanted to make a change. By installing a webserver to do local testing on would eliminate that need and make him a better developer or are you going to disagree with me on that as well?
    Wayne Luke
    ------------


  11. #11
    SitePoint Zealot Website Rob's Avatar
    Join Date
    Aug 2000
    Location
    Alberta, Canada
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wayne, you were commenting on a post I had made, and saying it was incorrect. I responded by pointing out specifics on a Windows 9x system and why my post was correct. So far I haven't disagreed with a thing you've said.

    I agree that installing a Web Server on your local machine to do the testing would make things easier, and help a person to become a better developer. It stands to reason that if the local machine (or parts of it) is setup as a Sever, then it will operate the same as an Internet Server. That was not the point of my post. I responding to the question as asked.

    From the nature and example of the question, I presumed jizbot was using a Windows 9x system--as a Windows 9x system, not as a Web Server. If I am wrong jizbot will correct me. That is also why I had asked if there was still a problem. Until then, there is not much else to say--as far as the original question goes.


Bookmarks

Posting Permissions

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