
File Manager Option in HostingSewa Cpanel.[/caption]
Step 3: Enter the public_html directory
[caption id="attachment_191" align="alignnone" width="1915"]
File Manager showing public_html directory[/caption]
Step 4: Click on the Settings button on the top right corner of File Manager. The button looks like this:
File Manager Setting Preferences showing Show Hidden Files (dotfiles) and other options.[/caption]
Step 6: Right-click on the .htaccess file and click on edit. If .htaccess file is missing you can create a new file name as '.htaccess'.
[caption id="attachment_194" align="alignnone" width="1087"]
Right-click menu on Cpanel File Manager[/caption]
Step 7: Now you add the following snapshot on the top of your HTACCESS file.
[alert-announce]Options -Indexes[/alert-announce]
[caption id="attachment_195" align="alignnone" width="1920"]
Modifying .htaccess file and saving changes from Cpanel.[/caption]
This is how directory listing is prevented using the .htaccess file.Advertisement