تحميل

How to block all PHP files in a particular folder in cPanel

Updated at
11/09/2022
Views
5331

Introduction

In today's article, I will guide you, How to block all PHP files in a particular folder in cPanel. So let's get started.

  • First go to your cPanel account, and then login.
  • After that, find out the “Files” section, In which you can see the “File Manager” option.
  • Simply click on it, and then go inside to the public_html.
  • Now go inside to that folder, which you want to block the all PHP files.
  • So now find out the ".htaccess" file, Basically this is a Hidden file, for seeing it, simply click on "settings" option, and then select "Show Hidden Files" option, and then click on this "save" button, So now here you can see all hidden files will appear.
  • Now select the ".htaccess" file and then right click on it.
  • Here you can see the "Edit" option, So simply click on it, and then a popup box will appear.
  • Again, click on this "edit" button, and then you will be redirected to a new page.
  • On this page, enter the following code inside the file, and then click on this "Save" Changes button.
  • RewriteRule ^.*\.php$ – [F,L]
  • Now, if you search this directory through your website, then it will show the 404 Error.

YottaSrc footer

لماذا تختارنا؟

أفضل الأسعار, تخزين SSD سريع و دعم فني
24/7 حقيقي

control panel icon
cPanel

إدارة موقعك من خلال CPanel بأحدث إصدار

security icon
سريع وموثوق وآمن

ضمان وقت تشغيل بنسبة 99.8٪.
لذا ركز على عملك!

support icon
دعم 24/7/365

ليلاً أو نهارًا ، مطر أو شمس ،
فريقنا هنا من أجلك!

cloud backup icon
نسخ احتياطي يومي

نسخ احتياطي يومي وأسبوعي.
ملفاتك آمنة!