Results 1 to 4 of 4
  1. #1
    Full Member ahmar's Avatar
    Join Date
    January 18th, 2005
    Posts
    481
    Help with .htaccess, Plz!!!
    My site is html based and have following lines in my .htaccess file but its giving me error [an error occurred while processing this directive] when I try to include php file <!--#include virtual="/filename.php" -->

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

    Till now I have been using html includes with no problem. So its not a problem from host. But its the file with php ext causing the problem.

    Please someone help me to edit .htaccess so that I would be able to include php file.

    Thanks in advance!!!
    <DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Posts
    164
    I dont think it's a .htaccess issue the code your using

    <!--#include virtual="/filename.php" -->

    Is used for including standard .html extensions not php includes. Php includes are in this format <? include("filename.php") ?>


    I dont think you can use virtual or file= in php includes

    Heres a useful link to help you http://www.hardcoder.com/scripting/p..._files.php#php

  3. #3
    "An Englishman In New York" TJ's Avatar
    Join Date
    January 18th, 2005
    Posts
    3,282
    Quote Originally Posted by ahmar
    My site is html based and have following lines in my .htaccess file but its giving me error [an error occurred while processing this directive] when I try to include php file <!--#include virtual="/filename.php" -->
    Hmmm.... you normally get that error when apache can't find the file it's trying to include. I include php files using SSI without any issues
    Code:
    <!--#include virtual="/cats_con.php"-->
    Rosey Bear Boutique
    Dressy Children's Fashions With Style!
    5% Commission : NYS Merch : Parasite FREE
       Akoss Hosting
    We also provide reseller accounts for ABW members.
    Ask for details


  4. #4
    "An Englishman In New York" TJ's Avatar
    Join Date
    January 18th, 2005
    Posts
    3,282
    however... I also think this line is wrong....

    AddType text/html .shtml .php

    IFAIK, this will make the php page work as a plain html page and NOT php if that is what you are trying to do, just take off the .php part
    Rosey Bear Boutique
    Dressy Children's Fashions With Style!
    5% Commission : NYS Merch : Parasite FREE
       Akoss Hosting
    We also provide reseller accounts for ABW members.
    Ask for details


  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. plz check .
    By leewelf in forum Events and Gatherings
    Replies: 2
    Last Post: June 25th, 2008, 05:34 AM

Posting Permissions

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