Home cPanel How to disable directory index in cPanel

How to disable directory index in cPanel

by Thạch Phạm

In today’s article, AZDIGI will guide you to disable the index of the folder in cPanel. In some cases, your folder like wp-content or wp-admin loses the index.php file, then all your folder files when accessed directly from the browser will all appear as shown below. This will cause many disadvantages for website management, especially the ability to reduce security because the files will be visible directly.

There are 2 ways to disable the display of the entire file directory above:

METHOD 1: CREATE AN INDEX.PHP FILE IN THE DIRECTORY

You go to the directory and create an index.php file and paste the code below into it.

For example, if I create the file index.php in the wp-content folder when accessing this folder, it will be blocked and show a 403 warning.

Don’t worry because your website can still get the image data inside this folder

<?php
// Silence is golden.

METHOD 2: DISABLE INDEX WITH THE TOOL ON CPANEL

You access the folder you want to disable => right-click on Manage Indices

Then you select No Indexing and Save it.

That’s already done, try to access it and you won’t see it anymore.

Đánh giá

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign