The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unable to use custom .htaccess ?? [moved]

Discussion in 'Security' started by cpaneluser001, Jul 9, 2005.

  1. cpaneluser001

    cpaneluser001 Registered

    Joined:
    Jul 9, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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.

    This is the contents of my .htaccess file. From what I can tell it is formatted correctly.

    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.
     
    #1 cpaneluser001, Jul 9, 2005
    Last edited: Jul 9, 2005
  2. lankyb

    lankyb Well-Known Member

    Joined:
    Sep 21, 2004
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Peterborough, UK
    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.
     
  3. cpaneluser001

    cpaneluser001 Registered

    Joined:
    Jul 9, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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.

     
  4. lankyb

    lankyb Well-Known Member

    Joined:
    Sep 21, 2004
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Peterborough, UK
    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.
     
  5. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    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
     
Loading...

Share This Page