Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess and SSI

    I have the following ".htaccess" to instruct the server to look in all ".htm", ".html" and ".shtml" for Server Side Include:

    AddType text/html .shtml
    AddHandler server-parsed .htm
    AddHandler server-parsed .html
    AddHandler server-parsed .shtml
    Options Indexes FollowSymLinks Includes
    DirectoryIndex index.htm index.html index.shtml index.asp index.php
    Options -Indexes
    It only works with the main page "index.htm" when uploaded to the main site directory. The rest of the pages --in any of the subdirectories below the main one-- return this error message "[an error occurred while processing this directive] "

    See it working here, the text on the upper right corner:
    http://www.teknician.com/index.htm

    See the error message here, on the upper right corner:
    http://www.teknician.com/services/main.htm

    What can I do to fix it? Any ideas please?
    Last edited by brduran; 06-15-2003 at 03:20 PM.

  • #2
    New Coder
    Join Date
    Dec 2002
    Location
    Central New York
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's nothing wrong with your .htaccess file. In fact, the [an error occured...] message is an indication that mod_include is scanning for and processing SSI+ directives in those directories.

    Rather, since you're having problems in different directories you should double check your include directives to and make sure that they point to the correct location for the included file.

    Good luck, let me know how it turns out.

    -Tim
    Timothy Boronczyk

  • #3
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi bluephoenix,

    The links are good, they point to the right location where the SSIed file is.

    See, SSI changes posted to the main and ssi directories work fine, whether I add a copy of ".htaccess" to every subfolder or not. But on the rest of the folders the opposite happens, again whether I use one main ".htaccess" or I add one to every subfolder.

    If you click on the links below you'll see the inconsistency I'm talking about. What we have here is the exact same file saved to different directories -- links already checked. I also uploaded a copy of ".htaccess" to each directory, just in case.

    No error
    http://www.teknician.com/ssi_temp.htm
    http://www.teknician.com/ssi/ssi_temp.htm

    Error
    http://www.teknician.com/services/ssi_temp.htm
    http://www.teknician.com/special/ssi_temp.htm
    ...and so on

    Any ideas welcome! Thank you.

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For your include directive are you using file or virtual?

  • #5
    New to the CF scene
    Join Date
    Jun 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi boggly,

    I'm using 'file'. I've tried 'virtual', same results. I sent an email to the webmaster and one of his ideas was to upload a copy of '.htaccess' to every folder -- didn't work. Then he added a directive that allow my '.htaccess' to override the default settings of the server -- did not work either. I kind of gave up, you could only have an error message showing on your website for so long. But mind you, if you're like me you like to get to the bottom of every problem.

    If you have any more suggestions, drop'em here. Thank you!

  • #6
    New Coder
    Join Date
    Jul 2002
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not to be overly simplistic, but are you 100% sure your path is correct? Sometimes you have to either put in a slash at the beginning of the path or remove one from it, othewise things won't work.

  • #7
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you are using virtual, you need to have your include start with a / and be from the top directory down. So if I was trying to include a file which was in my includes folder (mysite.com/includes/) I would use
    <!#--include virtual="/includes/filename.ext" -->

    Also, you are telling a lot of pages to look for server-parsed commands...that is going to add overhead to your loading and processing times, so if your host is a bit slow, you are going to (perhaps) see a little delay in loading times...depending on what those includes are doing.

    You should try and avoid using so many different pages with so many different extensions, try to keep them common for both your sake and your maintenance's sake.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #8
    New Coder
    Join Date
    Dec 2002
    Location
    Central New York
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why not try an absolute uri, as in:

    <!--#include file="http://www.mydomain.com/directory/included_file.html" -->

    -Tim
    Timothy Boronczyk

  • #9
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is almost never (basically never) suggested to use a FQDN in any linking system that links to your own site's interior. What if you run multiple domain names? What if you change the directory locations? What if you multiple domain names pointing to the same directory? What if you change your domain? What if you don't have www enabled in your FQDN? What if you run virtual domains? subdomains? etc. etc.

    You can also run into firewall issues when accessing through a DMZ setup while linking to full domain names back into your interior...

    As far as maintaing your site, especially as it gets larger and more complex, as you start refining and reordering your site to work better...virtual paths always work best...for images, for documents, for includes, for css, for js, etc. etc.
    Last edited by Feyd; 07-10-2003 at 11:29 PM.
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #10
    New Coder
    Join Date
    Dec 2002
    Location
    Central New York
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I still think he still should try an absolute path to make sure it's the configuration that's not working instead of a malformed url.

    As another thought, has the administrator hacked mod_include to disable the include statement? As far as I know an Apache configuration file can disable the execution of CGI but include directives can cause security breaches too. Perhaps mod_include was modified before compilation (that's the joy of Open Source)leaving SSI's abilities little more than echoing dates. and filemod timestamps.

    As for the myriad whatif FQDN arguments, read w3.org/Provider/Style/URI.html.

    -Tim
    Timothy Boronczyk


  •  

    Posting Permissions

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