Kindly wait a moment, post will be visible in just 5 seconds.

No Preview

Rizwan Khan

Posted on 6 March 2018

How to hide PHP extension using htaccess file

Ad Banner
No Preview

A few simple techniques can help to hide PHP, possibly slowing down an attacker who is attempting to discover weaknesses in your system.


It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.


I got it from https://www.php.net contributed by someone.


Instruction

1- Open your project folder such as public_html

2- Create a .htaccess file within root(public_html) folder

3- Paste the code given below

4 - Save your .htaccess file

After doing these steps just create a sample file to test such as example.php and try to open it in your browser and you will see 404 Not Found Error then remove .php and write like this localhost/project/public_html/example It works for all directorories and sub-directories Thank you hope you like it Note : If you already have .htaccess file make sure your RewriteEngine is not on. If it is on just remove the first line Dont forget to press Red Heart.

17

3K

3

No Preview

Rizwan Khan

India

Coding is an art and I love art

Explore more similar Post

2 Comments

NIKHIL KUMAR

30 June 2020

sorry bhai!

0
REPLY

Rizwan Khan

30 June 2020

Please be polite if you want something and update your comment

0
REPLY

NIKHIL KUMAR

30 June 2020

its okay!

0
REPLY

eswar_vgd

23 January 2020

It's not working in mvc.php on Godaddy windows server

0
REPLY