How to deny access to a file name in .htaccess?

by giovanny.lueilwitz , in category: Third Party Scripts , 3 months ago

How to deny access to a file name in .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by shyann , 3 months ago

@giovanny.lueilwitz 

To deny access to a specific file name in .htaccess, you can use the following code snippet:

1
2
3
4
<Files filename.extension>
    Order allow,deny
    Deny from all
</Files>


Replace "filename.extension" with the actual name of the file you want to deny access to. This code will restrict access to the specified file for all users. Make sure to save the .htaccess file in the root directory of your website for it to take effect.