www.webdeveloper.com
Results 1 to 7 of 7

Thread: Includes no longer working

  1. #1
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    138

    Includes no longer working

    I have been using the following code to load the contents of a navigation bar into my web page. This has been working for years, but recently all the websites I have designed and hosted on godaddy.com are not working correctly.

    I am referencing the navigation bar code which is in a folder which is one folder back from the page I want to load it into.

    Code:
    <!--#include file="../nav2.html" -->
    This has happened on numerous websites I have designed. What could have changed to prevent this from working, and is there another way to include this file in my web page?

    As a side note, if I move the nav2.html file into the same folder I can reference it by not using the "../" before the file name. However, since I want to load this same file into many pages, I don't just want to place the same file in each folder.

    Also, I have the same code in websites hosted by other hosting companies and I haven't had problems with those sites.

    Edit: The error I am getting with this code is [an error occurred while processing this directive].

    Lawrence
    Last edited by lkeeney; 08-02-2013 at 04:36 PM.
    Larry

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,105
    Maybe your host stopped supporting SSI?
    http://en.wikipedia.org/wiki/Server_Side_Includes

    I've been doing web development for quite some time now and I've never used includes in files like this. I've always handled includes in a server-side language such as PHP or ASP.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    138
    Quote Originally Posted by cbVision View Post
    Maybe your host stopped supporting SSI?
    http://en.wikipedia.org/wiki/Server_Side_Includes

    I've been doing web development for quite some time now and I've never used includes in files like this. I've always handled includes in a server-side language such as PHP or ASP.
    Thanks for your reply.

    I don't think the host has stopped supporting SSI because it works on the home pages where I reference a similar file which is located in the "includes" file which is in the same folder as the index.shtml file. However, it fails in all the other pages where the "includes" file is located up one folder and I have to use the "../" code to reference it.

    Lawrence
    Larry

  4. #4
    Join Date
    Mar 2011
    Posts
    1,108
    You can't use "../" in the path for the include file command. In this case, you should use a path relative to the site root directory, as in:
    Code:
    <!--#include file="/directoryName/nav2.html" -->
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    138
    Quote Originally Posted by rtrethewey View Post
    You can't use "../" in the path for the include file command. In this case, you should use a path relative to the site root directory, as in:
    Code:
    <!--#include file="/directoryName/nav2.html" -->
    Thanks for your advice. Why can't I use "../" in the path for the include file? I have been doing this for years on many different websites, and I never had a problem. All of a sudden, it doesn't work.
    Larry

  6. #6
    Join Date
    Mar 2011
    Posts
    1,108
    I'm not sure why you can't use '../' with the 'include file' directive, but it's different than 'include virtual'. See the Apache documentation.
    Rick Trethewey
    Rainbo Design

  7. #7
    Join Date
    Mar 2004
    Location
    Nevada, USA
    Posts
    138
    Quote Originally Posted by rtrethewey View Post
    I'm not sure why you can't use '../' with the 'include file' directive, but it's different than 'include virtual'. See the Apache documentation.
    OK. Just today I started using "include file" in an attempt to fix my problem. For all those years I have been using "include virtual", is what actually failed.

    I'm sorry about the confusion, as I forgot to mention I changed to "include file" today. However, I still have the problem using "include virtual".

    Edit:
    I did get it working using the full file address, but I still wonder why I worked all those years and all the websites stopped working at the same time.
    Last edited by lkeeney; 08-02-2013 at 11:43 PM.
    Larry

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles