search
HomeBackend DevelopmentPHP TutorialImplementation of domain name redirection system_PHP tutorial
Implementation of domain name redirection system_PHP tutorialJul 13, 2016 pm 05:12 PM
webThe essentialdomain nameaccomplishtechnologyofRedirect

The key technology of the domain name redirection system is to realize the redirection of Web pages (Redirectory). In essence, domain name redirection systems are completely different from virtual machine systems. There is a one-to-one correspondence between the virtual domain name and IP of the virtual machine. The domain name redirection system does not require one-to-one mapping of domain names and IPs. In other words, it does not require complex domain name resolution mechanisms and virtual machines to complete at all. What it does is when you request *.yourdomain, redirect your browser to the actual address where you store the Html page.
Let’s implement the domain name redirection system step by step:
(Assume your domain name is www.mydomain.com and the host address is 196.0.0.1).
First we need to set up DNS to point *.mydomain.com to our host address 196.0.0.1. (If you do not have your own DNS server, you can skip this step and contact your domain name service provider to ask them to help you point *.mydomain.com to 196.0.0.1)
The DNS management tool of win2000 does not allow the host to be The name is directly filled in as *, which means that we cannot directly point *.mydomain.com to the same IP address in the win2000DNS management tool. But we can achieve this by changing the winntsystem32dnsmydomain.dns file. This file is saved in text format and we can open it through WordPad.
We need to add a record of * A 196.0.0.1 at the end.
We update the server data file in the DNS management tool of WIN2000. You will find that there is an additional host "*" in the mydomain.com domain that we could not add directly. (Note: The DNS settings you make will not take effect until a few hours later.)
In order for this domain name redirection system to run on multiple platforms, we choose php+mysql to create the program part. Please check whether your web server has php installed. and mysql:
We use index.htm to read the HTTP header information sent by the browser and send it to dns.php. dns.php queries the database to get the redirection address and returns it to the client.
Create mysql database mydomain
CREATE TABLE dns (
main char(60),
link char(255)
)
main is used to save the * part of *.mydomain.com
Link is used to save the redirection address corresponding to the domain name.
Create index.htm:
<script> <br />this.location ="dns.php?url="+this.location.href; <br /></script>
Yes Friends will ask why not use PHP's GetAllHeader() function to obtain the HTTP header information sent by the browser. Because the function GetAllHeader() only supports the Apache web server, I believe most win2000 users use the iis server. Considering compatibility issues, we chose to use JavaScript to read the HTTP header information sent by the browser.
Create dns.php file:

$domain="mydomain.com"; //Domain name
$database="mydomain" //Database
$datauser="root "; //Database user

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629486.htmlTechArticleThe key technology of the domain name redirection system is: realizing the redirection of Web pages (Redirectory). In essence, domain name redirection systems are completely different from virtual machine systems. The virtual domain name of the virtual machine and...
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
如何在技嘉主板上设置键盘启动功能 (技嘉主板启用键盘开机方式)如何在技嘉主板上设置键盘启动功能 (技嘉主板启用键盘开机方式)Dec 31, 2023 pm 05:15 PM

技嘉的主板怎么设置键盘开机首先,要支持键盘开机,一定是PS2键盘!!设置步骤如下:第一步:开机按Del或者F2进入bios,到bios的Advanced(高级)模式普通主板默认进入主板的EZ(简易)模式,需要按F7切换到高级模式,ROG系列主板默认进入bios的高级模式(我们用简体中文来示范)第二步:选择到——【高级】——【高级电源管理(APM)】第三步:找到选项【由PS2键盘唤醒】第四步:这个选项默认是Disabled(关闭)的,下拉之后可以看到三种不同的设置选择,分别是按【空格键】开机、按组

CS玩家的首选:推荐的电脑配置CS玩家的首选:推荐的电脑配置Jan 02, 2024 pm 04:26 PM

1.处理器在选择电脑配置时,处理器是至关重要的组件之一。对于玩CS这样的游戏来说,处理器的性能直接影响游戏的流畅度和反应速度。推荐选择IntelCorei5或i7系列的处理器,因为它们具有强大的多核处理能力和高频率,可以轻松应对CS的高要求。2.显卡显卡是游戏性能的重要因素之一。对于射击游戏如CS而言,显卡的性能直接影响游戏画面的清晰度和流畅度。建议选择NVIDIAGeForceGTX系列或AMDRadeonRX系列的显卡,它们具备出色的图形处理能力和高帧率输出,能够提供更好的游戏体验3.内存电

主机的域名和主机的ip地址两者之间的关系是什么主机的域名和主机的ip地址两者之间的关系是什么Jan 14, 2021 pm 06:02 PM

主机的域名和主机的ip地址两者之间的关系是:一个IP地址对应多个域名。IP地址用数字化形式来对计算机网络中的主机进行网络标识,域名用字符化形式来对计算机网络中的主机进行网络标识。在Internet中,一个域名之内能够对应一个IP地址,但是一个IP地址可以被多个域名所对应。

请求的控件无效 NET HELPMSG 2191:2 个简单修复请求的控件无效 NET HELPMSG 2191:2 个简单修复Apr 15, 2023 am 09:13 AM

在TCP/IP协议套件中,域名系统是提供计算机名称到IP地址映射名称解析服务的协议之一。但是,有时它会出现故障,从而导致错误,例如请求的控制对此服务NETHELPMSG2191无效。DNS客户端和服务器协同工作,为计算机和用户提供计算机名称到IP地址映射名称解析服务。安装Windows后,客户端和服务器版本的操作系统默认启用客户端服务。一旦您在TCP/IP网络配置中指定了服务器的IP地址,DNS客户端就会查询服务器以发现域控制器并将计算机名称解析为IP地址。只有在服务

主板上的数字音频输出接口-SPDIF OUT主板上的数字音频输出接口-SPDIF OUTJan 14, 2024 pm 04:42 PM

主板上SPDIFOUT连接线序最近我遇到了一个问题,就是关于电线的接线顺序。我上网查了一下,有些资料说1、2、4对应的是out、+5V、接地;而另一些资料则说1、2、4对应的是out、接地、+5V。最好的办法是查看你的主板说明书,如果找不到说明书,你可以使用万用表进行测量。首先找到接地,然后就可以确定其他的接线顺序了。主板vdg怎么接线连接主板的VDG接线时,您需要将VGA连接线的一端插入显示器的VGA接口,另一端插入电脑的显卡VGA接口。请注意,不要将其插入主板的VGA接口。完成连接后,您可以

广联达软件电脑配置推荐;广联达软件对电脑的配置要求广联达软件电脑配置推荐;广联达软件对电脑的配置要求Jan 01, 2024 pm 12:52 PM

广联达软件是一家专注于建筑信息化领域的软件公司,其产品被广泛应用于建筑设计、施工、运营等各个环节。由于广联达软件功能复杂、数据量大,对电脑的配置要求较高。本文将从多个方面详细阐述广联达软件的电脑配置推荐,以帮助读者选择适合的电脑配置处理器广联达软件在进行建筑设计、模拟等操作时,需要进行大量的数据计算和处理,因此对处理器的要求较高。推荐选择多核心、高主频的处理器,如英特尔i7系列或AMDRyzen系列。这些处理器具有较强的计算能力和多线程处理能力,能够更好地满足广联达软件的需求。内存内存是影响计算

国内永久免费域名申请方法是什么国内永久免费域名申请方法是什么Jan 19, 2024 pm 04:01 PM

申请方法:1、通过工信部网站申请免费域名,等待审核通过后即可获得免费域名;2、通过DNSPod免费申请域名,用户可以在DNSPod上注册账号并申请免费的二级域名;3、选择一个可靠的免费域名服务提供商,通过对比和了解,选择一个可靠的提供商;4、注册账号,点击注册按钮,按照要求填写相关个人信息并创建账号;5、搜索并选择域名即可。

使用域名访问网站是啥意思使用域名访问网站是啥意思Mar 10, 2023 pm 02:18 PM

使用域名访问网站是指使用域名来进入一个网站,就是在浏览器里直接输入网站的网址来访问网站。网站都是存放在服务器上的,服务器有一个地址,也就是网站的ip地址,是一串数字,但是数字很难记,域名和DNS应用而生,DNS就是将网址和网站的ip地址对应起来;这样用户可以输入网址(域名),就相当于输入了网站的ip地址,就可以访问网站了。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool