0

I have Apache 2.4 and tried to redirect dotfolders/dotfiles to 404, but it didn't work. I have cpanel and need to do this setting globally not in .htaccess.

I added:

RedirectMatch 404 /\\..*(/.*|$)               
<Files ~ "^\.">
Order allow,deny
Deny from all
Satisfy All

to pre_main_2.conf and restarted Apache, but it didn't work

Please help

Thank you.

coffee-grinder
  • 26,940
  • 19
  • 56
  • 82
ka99
  • 1
  • 1
  • possible duplicate of http://stackoverflow.com/questions/4352737/apache-configuration-regex-to-disable-access-to-files-directories-beginning-wit – alexanderbird Apr 20 '16 at 21:00
  • btw, I have cpanel and need to do this setting globally not in .htaccess – ka99 Apr 20 '16 at 20:52
  • as far as I know, anything you can do in htaccess you can do in the main config file - I believe htaccess allows a subset of the configuration that the main config allows? The point is any solution that works for htaccess should also work for using the global config. – alexanderbird Apr 21 '16 at 05:07

0 Answers0