Useful commands for .Htacess [closed]

0

I would like to know some commands to use in .htacess that allow you to do the following actions.

1- Block access to all directories so that if the user tries to see the contents of this directory be barred with a warning or redirect to a page.

2 - Block the download of .php, .js, .css, .html and image files.

3 - open a file other than index.php as page index

If possible if you can tell me other useful commands that would help me a lot.

    
asked by anonymous 16.07.2015 / 12:48

1 answer

1

1 - Preventing directory listing:

Options -Indexes

2 - The server itself prevents PHP from downloading, but js, css and html run on the client side, if you prevent it from being downloaded, no one will see your site.

3 - To set default homepages use:

DirectoryIndex index.html index.php index.html

for example to define company.html:

DirectoryIndex empresa.html

    
09.08.2017 / 20:18