Blocking access to multiple files using htaccess

You can restrict access to multiple files by inserting the following code in your. htaccess file.
<FilesMatch "header.php|footer.php|somefile.html">
Order allow,deny
Deny from all
</FilesMatch>
This code will block all access attempts to the above files.

You can allow certain users to access these files by IPs using the following code:
<FilesMatch "header.php|footer.php|somefile.html">
Order allow,deny
allow from 1.2.3.4
allow from 5.6.7.8
Deny from all
</FilesMatch>
Numbers shown above are samples. You have to replace them with the real IP addresses that will gain access to files.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Disable SSH Password Authentication on Server.

It is recommended to disable SSH password authentication on your server to enhance security once...

Secure your servers against POODLE vulnerability for cPanel servers.

On October 14, 2014 Google has discovered a vulnerability in SSL V3.0 called POODLE that allows...

Shellshock Bash Bug Vulnerability Patching and Checking

A newly discovered bug allows attackers to cause vulnerable versions of Bash to execute arbitrary...

How to secure your browser against POODLE vulnerability.

On October 14, 2014 Google has discovered a vulnerability in SSL V3.0 called POODLE that allows...

How to login to FTP for cPanel accounts.

In order to login to your FTP account, you have to download a FTP client software. We recommend...

Powered by WHMCompleteSolution