首页 > 其他 > 详细

伪静态页面(10.24 第二十六天)

时间:2019-10-30 22:36:17      阅读:81      评论:0      收藏:0      [点我收藏+]

伪静态页面的搭建

http://www.test.com/index.php?id=1 (容易受到攻击)

http://www.test.com/index.html (静态页面只能够展示数据,安全性很高)

http://www.test.com/1.html(伪静态页面)

http://www.test.com/add_1.html(伪静态页面)

步骤:

1、需要开启站点的重写机制,修改apache配置文件,找到:

LoadModule rewrite_module modules/mod_rewrite.so   去掉前面的注释符号,重启apache

      需要apache支持解析  .htaccess文件,修改配置文件,找到:

AllowOverride None    修改为    AllowOverride ALL

2、新建 .htaccess文件,然后写入重写规则

RewriteEngine on    //开启重写机制

RewriteRule ([0-9]{1,})\.html$ index.php?id=$1  //重写规则,([0-9]{1,})匹配$1的值 \ 是转义符,html$表示URL中是以html结尾。

 

技术分享图片

 

伪静态页面(10.24 第二十六天)

原文:https://www.cnblogs.com/liujizhou/p/11768356.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!