SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Which way does the / go in links?

    Seems like a stupid question, but I ran into a problem the other day where an internal link on my site didn't work (when viewing it from the external server) until I manually changed the direction of the / and \ in the URL window of IE.

    Is this incorrect?

    HTML Code:
    <a href="../its/quotes.html">

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    no, that is correct, it should work properly, if you are having problems it could be because it is a relative link and perhaps you have something intefering with the location of the base directory such as htaccess.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.

    If I put the slashes in the opposite direction would it still be correct? i.e. Does the direction matter?

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Yes the direction does matter, and no it would not be correct.

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks!

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Sadly a few of the browsers (Firefox) are not smart enough to correct this common mistake. In my opinion they should.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Bah! I'm glad they don't. Next, they'll have to turn all those commas into dots, and then next thing you know, the all-knowing browser Overlords will just have the browser changing all the links to Overlord-Approved urls...

    Then we'll be living in a futuristic dystopia, and you know how that ends, leather-coated rebels fighting and robots and 'splosions and all that, and then we all die.

    Nah seriously, I like to be alerted by a 404 when I mistype a link as well. Hidden errors are uncorrected errors. My colleague has a regular habit of using the Windows slashes in his URLs, and I'm hoping to train him to try actually clicking on links after he writes them... and this is a good thing.

  8. #8
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually that is how I get my slashes backwards also.

    Sometimes I will do a quick edit of an internal link using notepad (my sites are mostly hosted on internal school servers). I will find the file using Windows Explorer, and then copy the address rather then having to retype.

  9. #9
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    In that case, having a text editor who can do ssearch-and-replace is pretty useful (find all \ and change to /). Then you can copy-pasta to your heart's delight but with working URLs. Esp since \ don't really appear anywhere else in regular text, so you're not going to accidentally change something you don't want changed.

  10. #10
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeh, I think I will use Dreamweaver to do a find and replace across the entire site.


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
  •