The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Webpage that links to a file on a flash drive

KatoKato Registered User regular
edited April 2009 in Help / Advice Forum
I have done some websites in the past. I am no expert by any means, but I am decent I suppose. I have an issue though...maybe someone here will have a solution.

I am doing a website that is stored on a jump drive. All of the local files needed for it are on the jump drive. I do have one problem. The pc that I started working on this on...designates the jump drive as E: My pc at home designates it as D: (heheh...that is a D and then a : ) Is there a way to write the code so that it will find the correct drive letter and the files on that drive on any pc? It works great at work, but at home, the pages will not load up. It can't find the drive. Anyone?

Signature??
Kato on

Posts

  • FightTestFightTest Registered User regular
    edited April 2009
    Is it just HTML?

    If so use relative directory links.

    <a href="./subdirectory/page.html">Like this.</a>

    ./ = starting in the current directory

    ../ = starting from the previous directory

    FightTest on
    MOBA DOTA.
  • exoplasmexoplasm Gainfully Employed Near Blizzard HQRegistered User regular
    edited April 2009
    Don't forget that you can specify / as the "root" of your site.

    a href="/home.html"

    for example.

    Edit: Ok actually that might not work with subdirectories. I haven't tested it.

    You could put XAMPP on the flash drive (get the mini version) and use that to serve the pages at localhost so you don't have less to worry about, though maybe overkill for just plain html.

    exoplasm on
    1029386-1.png
    SC2 NA: exoplasm.519 | PA SC2 Mumble Server | My Website | My Stream
  • flatlinegraphicsflatlinegraphics Registered User regular
    edited April 2009
    FightTest wrote: »
    Is it just HTML?

    If so use relative directory links.

    <a href="./subdirectory/page.html">Like this.</a>

    ./ = starting in the current directory

    ../ = starting from the previous directory

    this. relative links won't care where they are. they are relative.

    that means on your jump drive, you have a folder called 'site'. in that folder, you have an index.html, some folders, all the content. links should then be relative to that folder. so, you have an about.html with a link to the home page. the link should be:
    <a href="index.html">home</a>
    
    . if your images are in an folder called 'img', you'd link to 'img/some.gif'.

    if you are using dreamweaver, unless you designate a root folder in your site setup, it may auto insert an absolute link to the resource, like
    <a href="c:/website/site1/blah/blah/blah/index.html>
    
    or whatever.

    just remember that all resources have to be in a common folder on the drive.

    flatlinegraphics on
  • KatoKato Registered User regular
    edited April 2009
    FightTest wrote: »
    Is it just HTML?

    If so use relative directory links.

    <a href="./subdirectory/page.html">Like this.</a>

    ./ = starting in the current directory

    ../ = starting from the previous directory
    Yes' It is just basic html...nothing fancy at all. And thanks man. This seems to have worked just fine.

    Kato on
    Signature??
  • ProPatriaMoriProPatriaMori Registered User regular
    edited April 2009
    Links starting in the current directory don't need the preceding ./, though it doesn't hurt.

    ./pics/nakedlady.jpg is the same as pics/nakedlady.jpg for example

    ProPatriaMori on
Sign In or Register to comment.