Click here to Skip to main content
15,902,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i hide the fact that the web pages are written in PHP?
Posted

1 solution

It depends on what webserver and/or CMS you are using.
In Apache, you can use an AddHandler to make all .html files be processed by PHP. Then you can rename all your .php files to .html so people can't see .php in the URL. You may need to modify your server signature to remove references to PHP.
If you run a CMS like Drupal, it has its own ways of hiding the fact it's all PHP. Essentially, it parses the URL and generates the content, rather than simply mapping the URL structure to filesystem structure. You can do a similar thing yourself, but it's a lot of work.
The most important thing is to have no bugs that expose PHP! This is not as easy as it sounds.
In the end, you've got to ask yourself why. So what if anyone can find out that you use PHP. If you do it right, they can't see your PHP code, but only the HTML it generates.

Remember to vote for the answer, and mark it accepted if you like it. If you want to reply to this, make a comment, not another answer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900