美文网首页
apache隐藏入口文件index.php

apache隐藏入口文件index.php

作者: DragonersLi | 来源:发表于2018-04-30 14:29 被阅读526次
apache的rewrite模块,在httpd.conf文件中,去掉前面的 #号 ,完毕之后,重启apache
LoadModule rewrite_module modules/mod_rewrite.so 
image.png
在入口文件index.php同级目录中,放入一个.htaccess文件(记事本新建文本文件,文件另存为.htaccess)
内容如下:
        <IfModule mod_rewrite.c>
           RewriteEngine on
           RewriteCond %{REQUEST_FILENAME} !-d
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
        </IfModule>

相关文章

网友评论

      本文标题:apache隐藏入口文件index.php

      本文链接:https://www.haomeiwen.com/subject/iwvzlftx.html