SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    The short answer is yes... Herbster's Avatar
    Join Date
    Oct 2001
    Location
    Bay City, Oregon
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Server Independent Code?

    I have an excellent web hosting service. Rather than find ways to raise prices, they are constantly upgrading services for the same price and tech support has been excellent.

    One of my sites was recently moved to a new server and suddenly a lotta links just don't work anymore. Tech support has literaly bent over backwards to help me with the problems, but I can't help but think the real problem is buried in the way I designed the site.

    I don't recall reading anything about this here, but do any of you design your sites to be "server independent"? Is that even possible?

    I think most of my problems are with relative paths/URLs - which I thought would make the pages load faster.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Server Independent Code?

    Originally posted by Herbster
    do any of you design your sites to be "server independent"? Is that even possible?
    Yes, and yes again. I just use absolute, a.k.a. server, paths when pointing to images, links, scripts, etc. The form is something like
    Code:
    <img src="/images/icons/icon31.gif" ...
    The first / means to take the address from the server root, so because of this, my sites could easily be transported to any new server with a very minimal amount of work.

  3. #3
    The short answer is yes... Herbster's Avatar
    Join Date
    Oct 2001
    Location
    Bay City, Oregon
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mattjacob

    That's the way most of my links are written.
    On the new server, the cgi-bin directory is at the same level as my new http directory. On the old server, the cgi-bin directory was below my html (etc.) files. The paths are different from the one server to the other.

    My host is moving from Apache to Sun and apparently the change in directory structure is a requirement.

  4. #4
    SitePoint Wizard Ian Glass's Avatar
    Join Date
    Oct 2001
    Location
    Beyond yonder
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well you could set it up so that your old links will work in the new structure by creating a few aliases, but I don't know how to do that in Sun's server. Another option would be to use a global search and replace program like BK ReplaceEm (which I recommend) to rewrite all your hrefs so they work in the new environment. :-)

    ~~Ian

  5. #5
    The short answer is yes... Herbster's Avatar
    Join Date
    Oct 2001
    Location
    Bay City, Oregon
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ian!

    I haven't downloaded that file yet, but ya better believe I'm on my way...

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you could use a js page to hold an array of all your links and include them but this would mean a fair amount of work storing the links. But would also make less work of multiple referenced links which are in the same place

  7. #7
    The short answer is yes... Herbster's Avatar
    Join Date
    Oct 2001
    Location
    Bay City, Oregon
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Andrew-J2000

    There is definately a better way to handle the links, but I'm trying to hold JS to a minimum until I find out more about the systems visitors are using. This is a site for local residents and I suspect many may be using older computers/browsers and may have JS turned off.

    Turns out I was given the wrong paths.
    Took all yesterday to unscramble that mess, but at least the site is working again and I can get on to something else...


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
  •