Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    Default Unable to use custom .htaccess ??

    I'm a user of a webhost that uses cPanelX. I'm trying to use a custom .htaccess file in the root directory of my website and get the following error.

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@thiswaschanged.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    This is the contents of my .htaccess file. From what I can tell it is formatted correctly.

    AddType application/x-httpd-php .php .htm .html

    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>

    <Files *.inc>
    Order allow,deny
    Deny from all
    </Files>
    Is this something that is set globally on the server itsself or can I get this working through my /cpanel? My webhost isn't responding to my questions about it, that's why I'm trying here.

    Thanks for your help.
    Last edited by cpaneluser001; 07-09-2005 at 09:28 PM. Reason: typo

  2. #2
    Member lankyb's Avatar
    Join Date
    Sep 2004
    Location
    Peterborough, UK
    Posts
    104

    Default

    I found no problem with your htaccess file, some questionable actions, but no problem so it might be another cause -- without knowing fully why your server is flagging an error I cannot be sure. You will have to wait for your hosts reply to your support request.

    It could quite be that you have declared *.inc to be off limits. I'm not sure how fair this limit goes, but if the server is stopping itself from running *.inc this could be preventing your scripts from running needed files.

    The best way of doing an debug on a file you see the error on is to go through it, line by line.... see what is causing it. As I said, when I placed your .htaccess file on my server I found no error.... but then again I’m not running any php files needing any files with *.inc at the end of them.

    May I ask, why have you added protection for .htaccess files, the server does this automatically so there is no need for it.
    Ben aka LankyB

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    Default

    From what I read that just declares those files off limits to the web. The server can still access them. Atleast I know it can access .inc files because they work fine on other servers. Its just so joe schmoe can't come by and view your sensitive material. I didn't know htaccess was blocked by the server itsself though. Appearently neither did the guy who wrote the article about blocking it that I read.

    Just to test I tried taking all that out because you mentioned maybe there is a conflict with the server already blocking those. It still gives the save error with just this is the .htaccess.

    AddType application/x-httpd-php .php .htm .html

  4. #4
    Member lankyb's Avatar
    Join Date
    Sep 2004
    Location
    Peterborough, UK
    Posts
    104

    Default

    Your correct about the htaccess files only blocking incoming web requests, i did alittle more research into them early this morning, and you should recieve a 'Forbidden' error message when you try and view the .htaccess file -- With or without it being stated in the .htaccess file..... So thats 2/3 items sorted (so to speak).

    I dont see how ' AddType application/x-httpd-php .php .htm .html' will be causing problems for you... the easiest way to find out is to check the error log.

    When you goes through either the File Manager, or FTP.... in the main root directory of your area you should see a file called 'error_log'..... scroll all the way down, and see what the error is. This will then give you a much clearer idea what the problem is.
    Ben aka LankyB

  5. #5
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I think I see what your trying to do with parsing .htm and .html through php engine for embedded php inside html.

    It also sounds like the web server might have phpsuexec installed

    Try this setup for your .htaccess file as its working on several of my web sites

    AddHandler application/x-httpd-php .htm
    AddHandler application/x-httpd-php .html
    AddType application/x-httpd-php .htm
    AddType application/x-httpd-php .html
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

Similar Threads & Tags
Similar threads

  1. Need a custom skin done [moved]
    By mbraynard in forum Themes and Branding
    Replies: 1
    Last Post: 09-18-2006, 08:07 AM
  2. Form to htaccess [moved]
    By jumanji in forum New User Questions
    Replies: 1
    Last Post: 01-13-2006, 02:36 PM
  3. simple .htaccess question [moved]
    By laborspy in forum New User Questions
    Replies: 3
    Last Post: 09-15-2005, 09:22 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube