隐藏PHP页面 [英] Hide PHP page

查看:74
本文介绍了隐藏PHP页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏使用PHP编写网页的事实?

How can i hide the fact that the web pages are written in PHP?

推荐答案

这取决于您使用的是哪种Web服务器和/或CMS. /> 在Apache中,可以使用AddHandler使所有.html文件都由PHP处理.然后,您可以将所有.php文件重命名为.html,这样人们就不会在URL中看到.php.您可能需要修改服务器签名以删除对PHP的引用.
如果您运行像Drupal这样的CMS,它就有其自己的方式来隐藏所有PHP.本质上,它解析URL并生成内容,而不是简单地将URL结构映射到文件系统结构.您可以自己做类似的事情,但这需要很多工作.
最重要的是没有任何暴露PHP的错误!这听起来并不容易.
最后,您必须问自己为什么.那么,如果有人可以发现您使用PHP怎么办.如果操作正确,他们将看不到您的PHP代码,而只能看到它生成的HTML.

请记住对答案进行投票,并根据需要将其标记为已接受.如果您想回复此内容,请发表评论,而不是其他答案.
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.


这篇关于隐藏PHP页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆