zoukankan      html  css  js  c++  java
  • 伪静态页面(10.24 第二十六天)

    伪静态页面的搭建

    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结尾。

  • 相关阅读:
    sql性能调优的注意项
    mybatis获取刚插入数据的ID
    mysql
    JQuery
    JS
    css
    web前端
    python爬虫
    socket编程
    python基础
  • 原文地址:https://www.cnblogs.com/liujizhou/p/11768356.html
Copyright © 2011-2022 走看看