Home  >  Article  >  Backend Development  >  How to hide address in php

How to hide address in php

王林
王林Original
2019-09-20 17:53:303628browse

How to hide address in php

PHP隐藏地址的方法

1、修改Apache配置文件:httpd.conf

#LoadMoule rewrite_module modules/mod_rewrite.so   --去掉注释

2、查找httpd.conf 中的 AllowOverride 将其值改为All

3、重启服务器

4、根目录下创建文件名为 -- .htaccess 文件 

5、写入内容如下:

RewriteEngine on            //启动项
RewriteRule ^admin.html$ admin/admin_scms.php    //重写url --将admin/admin_scms.php 改为 admin.html
RewriteRule ^admin-([0-9]+)-([a-z]+)\.html$ admin/admin_scms.php?page=$1$flg=$2 [L] 
//$1代表:([0-9]+) $2代表([a-z]+) 隐藏url地址中的参数值

以上内容仅供参考!

推荐教程:PHP视频教程

The above is the detailed content of How to hide address in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn