1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Includes driving me nuts, please help

Discussion in 'Site & Server Administration' started by Ajeet, Sep 3, 2005.

  1. #1
    Hi,

    I have set up a server side include on http://www.oohoi.com/index.htm as:

    <!--#include virtual="headerfile.htm"-->

    and the headerfile.htm is in the same directory as the index.htm. But, the include does not work. I contacted hosting support and they say that it should work (and that they do not offer any scripting support :mad: ) I tried changing permissions to headerfile.htm and allowed ALL access (777), but that does not work either (currently reset to 644).

    Am pulling my hair out. Help appreciated.

    Thanks
    Ajeet
     
    Ajeet, Sep 3, 2005 IP
    mcfox likes this.
  2. Softbrix

    Softbrix Peon

    Messages:
    83
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    normaly when you do a ssi include you need to name the file xyz.shtml not .htm if you name it .htm and still use ssi then add this to your htdocs.

    AddType text/html .shtml .html .htm
    AddHandler server-parsed .shtml .html .htm
    Options Indexes FollowSymLinks Includes

    follow this link for info
    http://www.htmlite.com/HTA007.php
     
    Softbrix, Sep 3, 2005 IP
    Roman and Ajeet like this.
  3. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Right now the server thinks it's a html comment.

    If your using .ASP I think the file extensions need to be .asp OR there should be a way to tell the server to process .htm as .asp but I'm not a server geek ;)

    EDIT: what Softbrix said :)
     
    wrkalot, Sep 3, 2005 IP
  4. mcfox

    mcfox Wind Maker

    Messages:
    7,526
    Likes Received:
    716
    Best Answers:
    0
    Trophy Points:
    360
    #4
    I may be wrong here but at a glance I'd say your code should read:
    <!-- #include virtual="headerfile.htm" -->

    Note the spacing between "--" and "#"
     
    mcfox, Sep 3, 2005 IP
    Ajeet likes this.
  5. Ajeet

    Ajeet Well-Known Member

    Messages:
    2,511
    Likes Received:
    503
    Best Answers:
    0
    Trophy Points:
    185
    #5
    Testing all replies right now. Will be back.
     
    Ajeet, Sep 3, 2005 IP
  6. Ajeet

    Ajeet Well-Known Member

    Messages:
    2,511
    Likes Received:
    503
    Best Answers:
    0
    Trophy Points:
    185
    #6
    Hi,

    It did not work. I am now including a .shtml file (and the .shtml file is present in the same directory). I even tried playing with the spaces, but no permutation seems to work.

    Any further thoughts will be appreciated.

    Thanks
    Ajeet
     
    Ajeet, Sep 3, 2005 IP
  7. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If I'm in a regualr .html doc I have the following code:

    <?php
    include ('nav-top.php');
    ?>
    Code (markup):
    and in this file is normal .html code

    in my .htaccess (to ensure the includes works) I have

    AddType application/x-httpd-php .php .htm .html
    Code (markup):
    This has helped on many sites I run
     
    leeds1, Sep 3, 2005 IP
    Ajeet likes this.
  8. J.D.

    J.D. Peon

    Messages:
    1,198
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The other way around - there can be no space there. Some environments can handle both forms (e.g. ASP), but Apache v2 works only if there's no space.

    J.D.
     
    J.D., Sep 3, 2005 IP
    Ajeet likes this.
  9. Ajeet

    Ajeet Well-Known Member

    Messages:
    2,511
    Likes Received:
    503
    Best Answers:
    0
    Trophy Points:
    185
    #9
    This worked. Thanks a gazillion :)

    Quick query: This method of including links is SEO friendly, right?

     
    Ajeet, Sep 4, 2005 IP