Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htaccess

Discussion in 'General Discussion' started by MaRiOsGR66, Feb 27, 2013.

  1. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    Is there any way (to be enabled via cpanel) to allow the usages of .htaccess files only for the public_html directory and not any subdirectory under public_html ?
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    No, it is not possible.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    well acctually it is, I've finally found it

    Server Configuration »
    Tweak Settings »
    System »
    Depth to recurse for .htaccess checks [?]

    The maximum number of directories deep to look for .htaccess files when doing .htaccess checks. Values higher than 100 are discouraged.
     
  4. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Right, I stand corrected :eek:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:

    Could I be nosey here and ask the reason you'd want to do this?

    Thanks! :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    I believe I must correct myself again.
    This setting WHM-> Server Configuration-> Tweak Settings-> System-> Depth to recurse for .htaccess checks
    does not what MaRiOsGR66 is asking for.

    This setting is used by cPanel itself when it is checking .htaccess files, for example when you run EasyApache.

    In Apache documentation I couldn't find a setting for this kind of limit.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    "This setting is used by cPanel itself when it is checking .htaccess files, for example when you run EasyApache."

    thats explains it, I though it would be a measure of security for the web server, but it is for cpanael owns usage then
    its a different thing.

    but why would cpanel do that kind of check ? even for easyapache ? what is the purpose?

    - - - Updated - - -

    sometimes through vulnerable scripts they upload .htaccess that give the right to execute other things,
    as a added measure I thought that would help.
     
  8. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    I don't remember exactly, but it is searching for AddHandler directives and changing or removing them if they do not match installed PHP version.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. MaRiOsGR66

    MaRiOsGR66 Well-Known Member

    Joined:
    Feb 18, 2011
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    66
    cPanel Access Level:
    Root Administrator
    btw I've found what I was looking for here:

    /http://catn.com/vcluster/htaccess-revisited/

    Preventing recursive overrides

    Preventing recursive overrides is quite straightforward. Simply add something like the following to your <VirtualHost> configuration:

    # Allow overrides in the document root
    <Directory /path/to/docroot>
    AllowOverride All
    </Directory>

    # Disable overrides below the document root
    <Directory /path/to/docroot/*>
    AllowOverride None
    </Directory>
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice