Heim  >  Artikel  >  Backend-Entwicklung  >  在apache中隐藏php文件后缀_PHP教程

在apache中隐藏php文件后缀_PHP教程

WBOY
WBOYOriginal
2016-07-21 14:57:34974Durchsuche

如果不想让别人知道你的网站使用PHP程序以达到安全的目的.你可以按照下面的方法配置你的httpd.conf文件。

  你可以使用下面的方法来达到隐藏的目的:

  1.将PHP隐藏为其它语言

  在你的httpd.conf里任意位置添加下面这一行

  # Make PHP code look like other code types

  AddType application/x-httpd-php .asp .py .pl .jsp aspx

  2.对 PHP 使用未知扩展名

  在你的httpd.conf里任意位置添加下面这一行

  # Make PHP code look like unknown types

  AddType application/x-httpd-php .bop .foo .133t .los .abc

  3.对 PHP 使用 HTML 扩展名

  在你的httpd.conf里任意位置添加下面这一行

  # Make all PHP code look like html

  AddType application/x-httpd-php .htm .html

  重启你的apache把你的PHP文件名改为上面你所设置的文件后缀名。打开测试……

  然后就可用 类似

  http://127.0.0.1/index.jsp

  的路径访问

  http://127.0.0.1/index.php

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/364041.htmlTechArticle如果不想让别人知道你的网站使用PHP程序以达到安全的目的.你可以按照下面的方法配置你的httpd.conf文件。 你可以使用下面的方法来达到隐...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn