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!

<filesMatch> Not Working ...What Am I Doing Wrong?

Discussion in 'Security' started by Mike01, Jun 22, 2013.

  1. Mike01

    Mike01 Member

    Joined:
    Jun 10, 2013
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,
    I can't figure out what I'm doing wrong.

    Using the Include Editor, if I place this code into either the "Pre Main Include" or "Pre VirtualHost Include" or "Post VirtualHost Include" sections (All Versions):

    Code:
    <filesMatch "^(wp-config\.php|license\.txt|readme\.html?)">
    order allow,deny
    deny from all
    </filesMatch>
    
    I should specifically *NOT* be able to see this file:
    www.mydomain.com/wordpress/readme.html

    ...but I can...
    (and, yes, I restarted Apache ...version 2.2.24)
    This has worked perfectly on other Apache servers when placed into the httpd.conf file.


    RELATED:
    Also, directives like the following do not work for blog.myotherdomain.com (where... myotherdomain.com/blog is re-directed to the subdomain in the local .htaccess file)
    ...but it works correctly for www.mydomain.com/blog
    Code:
    <IfModule mod_alias.c>
     RedirectMatch 403 install\.php
    </IfModule>
    
    Note: I've tried it with and without the <IfModule> wrap and makes no difference either way.


    What am I doing wrong?
    Thanks!
    -Mike
     
  2. STS Admin

    STS Admin Well-Known Member

    Joined:
    Jul 8, 2012
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Your blog is in /wordpress folder so I think the code should be

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Or remove the "^", i.e.:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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