SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Broken Links

  1. #1
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Broken Links

    I am a newbie. I have just read Build Your Own Website The Right
    Way by Ian Lloyd and I am having a problem with broken links on my website.
    I created a website which works perfectly on my laptop but after uploading
    the website using FileZilla FTP to my ISPs server I have found that none of
    my links work. I have validated both my CSS and my XHTML using the W3C
    validator tools and found no errors. Please could you suggest what has gone wrong?

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,480
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Check your links code, i`m sure your links are absolute related to your computer, like this: <a href="file:///C:/pictures/xyz.jpg"> so they are searching for drive C:\, on your pc. Your links should be relative, like <a href="pictures/xyz.jpg"> , so they will search on your server. Could also be absolute or root-relative , but to your website (<a href="http://www.yoursite.com/pictures/xyz.jpg">)

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Hi jonathanbarton. Welcome to the forums.

    If webcosmo's answer doesn't help, please post a link to your site, or at least an example of the code used in your links.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,804
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Try right click on your online images and look for image source or image details and the online path to the image should be displayed.

  5. #5
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    super glue?


    ...no wait, you meant web links...


    Hi jonathanbarton. Welcome to the SitePoint

    it is likely that you built your site using absolute links ( possibly using Dreamweaver?). So when you the files to yours server your links are wrong( the HREF string didn't change, but the server wouldn't have an idea of where "http://mycomputer/c-drive/webpage/index.html"

    Go back an check your links if the HREF begins with "http:" or "file:" you have used absolute links!

    Unless you are building your site directly on a server ( and NEVER expect to move it to another location) it's almost always better to use relative links.

    examples:
    href="index.htm" ( a file in the TOP directory of your site, linking to INDEX.HTM file which is ALSO in the top directory)
    href="folderName/file.htm" ( a file in the TOP directory of your site, linking to FILE.HTM , file resides in folderName, folderName in the top directory)
    href="../other.htm" ( a file , linking to other.HTM...which is in a parent directory )


    hope that helps

  6. #6
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Ralph.M. As far as I can make out I am using relative links at the moment. I copied my code below:

    <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="about.html">About Us</a></li>
    <li><a href="events.html">Club Events</a></li>
    <li><a href="contact.html">Contact Us</a></li>
    <li><a href="gallery.html">Image Gallery</a></li>
    </ul>

    The url of the website is: http://homepage.ntlworld.com/jonathanbarton1/

    If you visit the website you will see that I cannot get the links to work. Do you have any other suggestions?

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    OK, so the question we need to ask now is—Where are those pages currently located on your server? They should be inside the /jonathanbarton1/ folder, but they aren't there. (Are you sure you have uploaded them at all? Check in your FTP program to make sure they actually got uploaded.)

    (Note also that in your online version of the menu, you have a gap before the gallery URL:

    <a href=" gallery.html">

    Remove that gap before the g or you will have a problem with that link.)

    Edit:

    I just did some fishing, and discovered that the reason your links are not working is that your file names start with a capital letter (e.g. About.html) while your links point to files without a capital at the start (e.g. about.html). As a rule, never use capital letters in HTML or CSS code. It's just one more source of trouble you can do without. )
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  8. #8
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that. It is now working.

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    No worries, glad we could help. Do come back if you have more questions.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •