Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    I need to put together absolute addresses from the page source.



    At the fox news website, you view the page source from

    www.foxnews.com

    and an HREF of

    <a href="/story/0,2933,89306,00.html">

    gives you an absolute address of

    www.foxnews.com/story/0,2933,893,00.html



    Simple enough. Here's where I'm confused. I go to www.1001freefonts.com and view the page source of from the page located here:

    http://www.1001freefonts.com/fonts/afonts.htm

    and an HREF of

    <a href=/fontsa1/AARDCAF.ZIP>

    doesn't give me http://www.1001freefonts.com/fonts/fontsa1/AARDCAF.ZIP

    it gives me http://www.1001freefonts.com/fontsa1/AARDCAF.ZIP



    How does that work, I thought if you were in the fonts folder, an HREF of /fontsa1/AARDCAF.ZIP would put you in a subfolder of the folder you're in. Does that slash at the beginning of the HREF always put you back to the root of the web address?
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Is there a <base href anywhere in the document? That can override relativity in links.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    The only other thing I can think of is the server is configured to do that possibly (?) I know I've seen Geocities display an image w/o the file extension, but it doesn't work with all geo sites either.
    Ex (not exact urls):
    I typed in
    "http://geocities.yahoo.com/someuser/1.gif"
    then
    "http://geocities.yahoo.com/someuser/1"
    and the picture still came up. Weird.
    - Brian

  5. #4
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    Thanks for the replies. After checking out the source to quite a few pages, what I think I'm seeing is that if you have

    www.add.com/images/thumbs.html

    As the page with the links and on that page you have an HREF of

    <a href="full/img.jpg">

    Your absolute address is

    www.add.com/images/full/img.jpg

    Whereas a single little slash in front of the HREF brings you to the root:

    <a href="/full/img.jpg">

    would be

    www.add.com/full/img.jpg


    I'm pretty sure this is how is works (somewhere some veteran HTML coder is rolling his eyes). If anyone can amend or correct this, please do so.

    Oh, and thanks for the tip on the BASE HREF. I'll have to be on the lookout for that, too.
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  6. #5
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    when you do a <a href="/somedir/stuff.html"> it goes from the WEB ROOT. This is dependant on server

    When you do a <a href="somedir/stuff.html"> it goes from the current directory heirchy...

    for example, here's your structure:
    WEBROOT FOLDER
    Contains: somedir (directory), stuff.html
    /WEBROOT/somedir FOLDER
    Contains: somedir(directory), stuff1.html
    /WEBROOT/somedir/somedir (directory)
    Contains: stuff2.html

    put a page in /WEBROOT/somedir:
    <a href="/somedir/stuff.html" will point you to the red (stuff.html)
    <a href="stuff.html"> will do the same

    <a href="somedir/stuff1.html"> will pint you to the blue (stuff2.html)
    <a href="/somedir/somedir/stuff2.html"> will do the same

    Does that help?
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You're correct.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Damn you... I did that as you were typing it oput... just beat me to it
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  9. #8
    Senior Member mikeycorn's Avatar
    Join Date
    Mar 2003
    Posts
    272
    Member #
    891
    I like the color coded answers, though! Thanks a bunch.
    ~ mikeycorn
    With over 72,000 questions worth of user submitted quizzes, it's the world's most popular quiz creation software:
    PEST - The Personal Exam Self-Tester

  10. #9
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Originally posted by mikeycorn
    an HREF of
    <a href=/fontsa1/AARDCAF.ZIP>
    gives me http://www.1001freefonts.com/fontsa1/AARDCAF.ZIP
    a "/" at the beginning of the link tells the browser to look relative to the root address.

    a "./" or no leading slash tells the browser to look relative to the current folder.

    a "../" tells the browser to look relative to the parent directory.

  11. #10
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    LOL... next time I'll read the post to see if it was resolved before posting my response.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com