Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • page rank 3 and page rank 5 for sale (In: I Want to Sell My Website)
  • Redirection of a page (In: Coding & Databases - PHP, ASP, Perl, etc.)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    Gshaughn
    Joined: Jul 21, 2000
    # Posts: 78

    View the profile for Gshaughn Send Gshaughn a private message

    Posted: 2005-Sep-16 17:33
    Edit Message Delete Message Reply to this message

    Hello,
    I am trying to implement a Server Side Include HTML footer file on an HTML page. I am running on an Apache web server. It is not displaying, and I am sure it's b/c I don't have the proper rules/configurations in the .htaccess file.

    This is what I currently have in my .htaccess that pertains to includes:
    Options +Includes
    XBitHack on

    -I enabled non-executable server side includes in the control panel
    -I created the include file, and called it using <!--#include virtual="footer.html"--> from the html page.

    Why isn’t it working? Does another web server configuration or .htaccess configuration need to take place for it to work? I am not very familiar with Apache, chmod, directives, etc.

    Any help would be greatly appreciated. I can't change the page names to .shtml, and would like to have this work as .html.

    Thanks!
    Greg







    bhartzer
    Staff
    Joined: Jun 08, 2000
    # Posts: 7042

    View the profile for bhartzer Send bhartzer a private message

    Posted: 2005-Sep-16 17:39
    Edit Message Delete Message Reply to this message

    Probably the best tutorial about SSI Includes I've seen is here.

    You either need your pages to have the .shtml extension or you need to tell the server to parse your .html pages as .shtml.



    Gshaughn
    Joined: Jul 21, 2000
    # Posts: 78

    View the profile for Gshaughn Send Gshaughn a private message

    Posted: 2005-Sep-16 17:54
    Edit Message Delete Message Reply to this message

    Thanks for the help...the tutorial you pointed me to was helpful, but left out the 'handler'. Once I added that it worked.

    For anyone's future reference, this is the combo that worked in my .htaccess file...

    Options +Includes
    AddType text/x-server-parsed-html .html
    AddHandler server-parsed .html

    Thanks!
    Greg



    g1smd
    Staff
    Joined: Jul 28, 2002
    # Posts: 10465

    View the profile for g1smd Send g1smd a private message

    Posted: 2005-Sep-16 21:26
    Edit Message Delete Message Reply to this message

    You are supposed to name your pages as .shtml and then includes will work "out of the box".

    Since you didn't change the name they use, then yes, you have to add the handler declaration.



    lizardz
    Joined: Nov 12, 2004
    # Posts: 1394

    View the profile for lizardz Send lizardz a private message

    Posted: 2005-Sep-17 04:38
    Edit Message Delete Message Reply to this message

    Whatever you do, don't name your pages .shtml, ssi is such a weak scripting language that the odds are very high that you will dump it in favor of a real one soon in the future, like php. Personally, I have never understood why anyone uses ssi when it's so easy to do php includes.



    Prowler
    Staff
    Joined: Aug 14, 2000
    # Posts: 1835

    View the profile for Prowler Send Prowler a private message

    Posted: 2005-Sep-24 05:45
    Edit Message Delete Message Reply to this message

    When you set the XbitHack on, you need to set the file permission to execute for the SSI to fire. Chmod the file to 755 (one of the many options). Unless you set the file permission, the server will not know which file to parse.

    Setting this "AddType text/x-server-parsed-html .html" will force the server to parse all html pages, adding to the server overhead. XbitHack avoids the extra overhead. If you run a modest sized site, it may not matter much. But a heavy traffic to some of the parsed pages might present server overload.





    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions