By default when your net server doesn’t discover an index file (i.e. a file like index.php or index.html), it robotically shows an index web page exhibiting the contents of the listing. This might make your web site susceptible to hack assaults by revealing essential data wanted to use a vulnerability in a WordPress plugin, theme, or your server typically. On this article, we are going to present you the best way to disable directory browsing in WordPress.
Why You Must Disable Directory Browsing in WordPress
Directory browsing can be utilized by hackers to seek out out if in case you have any recordsdata with recognized vulnerabilities, to allow them to reap the benefits of these recordsdata to realize entry. For the excellent safety of our websites, we use Sucuri for WordPress safety. They’ve a easy dashboard which permits us to do that and carry out many different WordPress safety strengthening steps with in few clicks.
Directory browsing can be utilized by different folks to look into your recordsdata, copy photos, discover out your listing construction, and different data. This is the reason it’s extremely beneficial that you simply flip off listing indexing and searching.
To disable directory browsing in WordPress all it’s worthwhile to do is add a single line of code in your WordPress web site’s
.htaccess file situated within the root listing of your web site. To edit the
.htaccess file it’s worthwhile to hook up with your web site utilizing an FTP shopper.
You May Also Like : How to Display Recently Registered Users in WordPress
As soon as related to your web site, you will see a
.htaccess file in your web site’s root listing.
.htaccess is a hidden file, and if you can’t discover it in your server, it’s worthwhile to just remember to have enabled your FTP shopper to indicate hidden recordsdata.
You possibly can edit your
.htaccess file by downloading it to your desktop and opening it in a textual content editor like Notepad. Now on the finish of your WordPress generated code within the
.htaccess file merely add this line on the backside:
Now save your
.htaccess file and add it again to your server utilizing your FTP shopper. That’s all it’s worthwhile to do. Directory browsing is now disabled in your WordPress web site and folks making an attempt to find a listing index in your web site will likely be redirected to WordPress 404 web page.
If you liked this article, make sure to hit the bell for getting our latest updates and share this article with your friends in every social media platforms.