指向两域名指向

域名指向  时间:2021-02-21  阅读:()

两域名指向

2 different sites are placed in the same virtual space, and 2domains are used to access their respective sites, as follows:1, first of all to ensure that space support ASP, the openingof virtual space, requiring space providers bound 2 domainnames to space, such as FTP control panel, you can add your owndomain name, it is the best;

2, open 2 folders in the space root directory, such as AA andBB, for placing 2 different sites;

3. Build the index.asp file below and upload it to the rootdirectory.

Program code

<%if Request.ServerVariables ("SERVER_NAME") = "aa. com" then"the first input URL

Response.redirect "aa/index.htm" - forwards it to theappropriate folder

Else%>

<%end if%>

<%if Request.ServerVariables ("SERVER_NAME") = "www.aa.com"then

Response.redirect "aa/index.htm""

Else%>

<%end if%>

<%if Request.ServerVar iab les ("SERVER_NAME") = "bb. com","then", second input URLs

Response.redirect "bb/index.htm" - forwards it to theappropriate folder

Else%>

<%end if%>

<%if Request.ServerVariables ("SERVER_NAME") = "www.bb.com"then

Response.redirect "bb/index.htm""

Else%>

<%end if%>

Method one

<%if Request.ServerVariab les ("SERVER_NAME") =www.aiweb.cnthen

Response.redirect "aiweb/""

Else%>

<%end if%>

<%if Request.ServerVariables ("SERVER_NAME")

=http://www.yangchun.org then

Response.redirect "yangchun/""

Else%>

<%end if%>

So you jump two different directories. . . . . . Theoreticallybound domains can be bound indefinitely.

(2) a simple domain name automatic turning source code<

If Request.ServerVariables ("SERVER_NAME") =www.aiweb.cn thenResponse.redirect "aiweb/index.asp""

Else

Response.redirect "websites/""

End if

% >

This ASP code function allows you to automatically redirect tothe corresponding domain name site when two domains arepointing to the same host

Method two

<% 'ASP code initial identification

Get the value entered by the HTTP and pay the value to HTOSTHost=lcase (request. servervariables ("HTTP_HOST"))

' start conditional jump'

Select CASE host

"If the value of HOST is www.czboai. com, select the command ofevent case" www. czboai.com "

CASE "www. czboai.com""

'response.redirect' is the URL jump code.

Response.redirect "czboai/""

CASE "www. i2345. com""

Response.redirect "i2345/""

END Select

% >

The above code is saved in the root folder of the virtual host,and is called index.asp. When you remotely accesswww. czboai.com and www. i2345.com, you first access theindex.asp file and then judge your website.

Method three

<

Host=lcase (request. servervariables ("HTTP_HOST")) gets thevalue of the HTTP input and pays the value to HTOST

Select CASE host ' start conditional jump

CASE "blog. siyizhu. com". If the value of HOST isblog. siyizhu. com, select the command of event case

"blog. siyizhu.com"

Response.redirect "/blog/" to the specified music directoryCASE "siyizhu.com/temp/time.htm". If the value of HOST isblog. siyizhu. com, select the command of event case

"siyizhu.com/temp/time.htm"

Response.redirect "temp/time.htm" to the specifiedtemp/time.htm file

"CASE ELSE" if not within the specified range

Response.redirect "/bbs/" to the BBS directory

END select

% >

Concrete practice:

The domain name of the turn needs to be bound to IP of spacefirst, want to turn a few to bind a few

Suppose that your default home space is INDEX.ASP, and add thecode to the head of the INDEX.ASP file

Upload it on OK

Method four

In the virtual host space is growing, in general circumstances,a web site is endless (software, movies, Download class is notlisted in it) .

So, how do you make the space available? Please follow thesesteps:

Step 1: creating the steering control page

Create a default home page file for the web (usually index.aspor default.asp) as follows:

<

Select, case, request. servervariables ("http_host")

Case "www.abc1.com" domain 1

Server.Transfer ("index_abc1.asp")

Case "www.abc2.com" domain 2

Server.Transfer ("index_abc2.asp")

Case "www.abc3.com" domain 3

Server.Transfer ("index_abc3.asp")

' . . . Continue to add. . . . . .

Case else 'domain name N

Server.Transfer ("index_abcN.asp")

End select

% >

The second step: create the corresponding steering fileCreate "index_abc0.asp"-"index_abcN.asp", as the homepage ofeach website.

The third step: the IP address of multiple domain name isresolved to the same website space

For example, the IP address of"www.abc1.com" - "www.abcN.com"is all parsed into the WEB space of "www.abc1.com".

The fourth step: setting up the web site' s WEB serviceThe alias for setting up the WEB service is: "www.abc1.com,www.abc2.com, www.abc3.com. . . . . . www.abcN. com" (Not e: al i asis separated by a space)

Ha ha, now you can use like "http://www.abc1.com"", . . . . . . Topclass URLs like "http://www.abcN.com" to access the same WEBspace,

And get a different page.

Immediately save the "N-1" space costs, is not it cool?Method five

For those who specialize in registering domain names, the spacebecomes more valuable, but it is impossible for each domain nameto register a space. Let' s talk about a space binding multipledomain names, and each domain name does not interfere with eachother.

The first thing to do, of course, is to parse each domain nameinto the IP of the space, and then bind the domain names on thespace control panel, set the default home page for index.asp,

and look at the code.

<

"What domain name is the first access to the current access?Domainname=Reque st.ServerVar iab les

("SERVER_NAME") , 'Reque st.ServerVar iable s ("HTTP_REFERER")'analyze the domain name and turn to the specified pageIf instr (domainname, www. im286.com) then

This method applies to binding domain names, changes theprevious forum home page to wwwindex.asp, and if the domain nameis www. im286. com, it will introduce the previous home page% >

"--#include file=" wwwindex.asp "-- >!

<

Elseif instr (domainname, domain. im286. com) then

'URL turn, this method applies to URL steering, and does nothide true URL

Response.redirect "http://www. im286. com/domain""

Elseif instr (domainname, pr. im286.com) then

云基最高500G DDoS无视CC攻击(Yunbase),洛杉矶CN2GIA、国内外高防服务器

云基成立于2020年,目前主要提供高防海内外独立服务器用户,欢迎各类追求稳定和高防优质线路的用户。业务可选:洛杉矶CN2-GIA+高防(默认500G高防)、洛杉矶CN2-GIA(默认带50Gbps防御)、香港CN2-GIA高防(双向CN2GIA专线,突发带宽支持,15G-20G DDoS防御,无视CC)、国内高防服务器(广州移动、北京多线、石家庄BGP、保定联通、扬州BGP、厦门BGP、厦门电信、...

妮妮云80元/月,香港站群云服务器 1核1G

妮妮云的来历妮妮云是 789 陈总 张总 三方共同投资建立的网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑妮妮云的市场定位妮妮云主要代理市场稳定速度的云服务器产品,避免新手购买云服务器的时候众多商家不知道如何选择,妮妮云就帮你选择好了产品,无需承担购买风险,不用担心出现被跑路 被诈骗的情况。妮妮云的售后保证妮妮云退款 通过于合作商的友好协商,云服务器提供2天内全额退款,超过2天不退款 物...

创梦网络-江苏宿迁BGP云服务器100G高防资源,全程ceph集群存储,安全可靠,数据有保证,防护真实,现在购买7折促销,续费同价!

官方网站:点击访问创梦网络宿迁BGP高防活动方案:机房CPU内存硬盘带宽IP防护流量原价活动价开通方式宿迁BGP4vCPU4G40G+50G20Mbps1个100G不限流量299元/月 209.3元/月点击自助购买成都电信优化线路8vCPU8G40G+50G20Mbps1个100G不限流量399元/月 279.3元/月点击自助购买成都电信优化线路8vCPU16G40G+50G2...

域名指向为你推荐
96155北京公积金96155客户服务电话,怎么一步一步进到修改还款额度的地方?google竞价排名google竞价排名怎么做外网和内网什么是外网和内网?1433端口怎么去看1433端口唱吧电脑版官方下载唱吧有电脑版吗创维云电视功能创维云电视是指什么人人逛街人人都喜欢逛街吗idc前线求电影敢死队电影里的歌曲!二层交换机什么是二层交换机和三层交换机???什么是云平台什么是云平台管理软件,一个云平台软件应该具有哪些基本功能
国外免费vps 免费申请网页 国内免备案主机 highfrequency 256m内存 512au 嘉洲服务器 域名接入 河南移动m值兑换 昆明蜗牛家 爱奇艺vip免费领取 移动服务器托管 测试网速命令 中国联通宽带测试 闪讯网 qq空间打开很慢 免费服务器 西安电信测速网 免费服务器代理 三星789 更多