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.

How do I prevent php execution by directory name?

Discussion in 'Security' started by lbeachmike, Sep 22, 2013.

  1. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
    Hi there -

    I'd like to prevent php execution for any file on all accounts of my servers by directory name.

    For example - if the directory name is "cache" or "images" or "uploads" or "downloads" (or any/all subdirectories thereof) I want to disallow php from running in those directories. I realize this can be done at the directory level via .htaccess, but I want to setup global controls.

    Is there a way to do this?

    Thanks.

    Mike
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I am not aware of a specific rule to block PHP execution for specific directories by name. However, the following document will be useful if you develop a rule to use in the domain name's VirtualHost entry in the Apache configurationn file:

    Custom templates that will apply to all virtual hosts

    Thank you.
     
Loading...

Share This Page