How to hide address in php

王林
Release: 2023-02-24 15:00:01
Original
3820 people have browsed it

How to hide address in php

PHP隐藏地址的方法

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

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

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地址中的参数值
Copy after login

以上内容仅供参考!

推荐教程: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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template