TypechoJoeTheme

尘遇 logo

当我遇上你
排行榜
统计

实现url地址不变但不同IP显示不同内容

醉书生站长
3周前
0 评论
103 阅读
检测收录...
17:22

不同ip打开网站不跳转实现url相同,但是j页面展示内容不同!
比如说:上海那边打开网站是:春花秋月何时了……但是其他地方打开后一看:关关雎鸠 ,在河之洲……

教程开始:
一共需要3个文件,放在根目录, 两个文件夹:a文件夹和b文件夹(自己建立)。

原理:访客进入网站,网站自动检测ip,如果是在ip库里的就展示b文件夹的内容。通过php调用而且利用伪静态让原本显示为
chenyu.me/b/1.html显示为chenyu.me/1.html

如果是ip库里没有的,就展示a文件夹的内容。通过php调用而且利用伪静态让原本显示为chenyu.me/a/1.html显示为chenyu.me/1.html

如果你访问chenyu.me/333/1.html这个文件只在a目录下有,但是b目录下没有就直接跳转到b目录的首页自动读取/b/index.html。

首先是.htaccess文件

<ifmodule mod_rewrite.c="">
RewriteEngine on
RewriteRule ^(.*).html index.php?p=$1&d=0
RewriteRule ^(.*)/$ index.php?p=$1&d=1
</ifmodule> 

Nginx:

rewrite ^/(.*).html /index.php?p=$1&d=0;
rewrite ^/(.*)/$ /index.php?p=$1&d=1;

其次是根目录下的index.php

  • VIP(1)区
  • 扫码关注本站公众号,回复“遇”,获取验证码
  • 最后是ip.txt:|开始IP|终止IP
    示例:

    |192.168.1.1|192.168.1.255
    本文共289个字数,您已阅读:平均阅读时长≈1分钟。
    朗读
    点赞
    2
    支持
    海报
    欢迎
    要时间嘉许,等春风得意,我正好遇上你!

    微信/QQ/支付宝三合一收款码

    微信
    QQ
    支付宝
    打开微信/QQ/支付宝扫一扫,即可进行扫码打赏!
    版权属于:

    尘遇

    最后修改:

    2021 年 05 月 05 日 06 : 28 PM

    本文链接:

    https://chenyu.me/1351.html(转载时请注明本文出处及文章链接)

    暂无评论

    光阴者,百代之过客

    今日已经过去小时
    这周已经过去
    本月已经过去
    今年已经过去个月

    最新回复

    1. kzkLv.1
      2021-05-10

      {!{data:image/webp;base64,UklGRi4SAABXR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h5PE+jGoZq+ZJA9W1VX4F7W6S9541YvgYtZtcDPskH2p1eP7l/Xn07aHxe5aVXw1kRXgZ+ZRzp2yGy6d8/Sbl/WHT+cGLttXfiyRX4zJnqMHtK/h2O7Fg1qVCxZUOB7Nn7TJjU602iDfCaMH+HSp4ttmyZ1qpQtmlew+m9W/7H6j9V/rP5j9R+r/1j9x+o/Vv/h1Vj9RwAAVlA4INIBAABQNQCdASoCAywBP3G42WW0ryunIAgCkC4JaW7hd2EbQAnsA99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snCgAA/v+tHgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}!}

    2. 遇上你Lv.1
      2021-05-08
    3. AlanineLv.1
      2021-05-04
    4. 曾经Lv.1
      2021-05-04
    5. 郎君Lv.1
      2021-05-04