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.

<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:
    7
    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:
    47
    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

     
  3. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Or remove the "^", i.e.:
     
Loading...

Share This Page