SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict DevilBear's Avatar
    Join Date
    Oct 2001
    Location
    Hades
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PATH_INFO and document base

    Hi folks,

    I'm working on my first attempt to use URIs like so:

    www.site.com/site.php/val1/val2

    rather than www.site.com/site.php?var1=val1&var2=val2

    The problem with this is that all the relative image URIs on the page are evaluated relative to site.com/site.php/ rather than site.com/

    I can fix this with the <base> tag, but I'm wondering if it can't be addressed with a HTTP header. I've been playing with Base, Content-Location, and Content-Base headers, all to no avail.

    Has anyone else solved this problem in this manner? Or some other way besides the <base> tag?

  2. #2
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, don't know if this is informing but if you start the path to image/file with a forwardslash (/) it will begin at the document root.
    Example:
    in the file www.example.com/some/path/file.php I have two urls, the first one points to
    image.png and the other to
    /image.png
    the real location of the image.png in the first example would be
    www.example.com/some/path/image.png
    and in the second example it would be
    www.example.com/image.png

    Hope this helps!
    - website


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
  •