domain redirect script

1 отговора 30 прегледа
#1

domain redirect script

dali tova shte trugne i kak da se knofigurira, che neshto ne mi e mnogo iasno kude kakvo tochno triabva da se zamesti.

tova triabva da gleda ot koi domain ima zaiavka kum site i da gi preprashta kum otdelni direktorii /pone na men tova mi triabva/

oshte neshto, kak da krustia file sus scripta i kude da go sloja?

predvaritelno mnogo vi blagodaria za otgovorite

'**************************************
' Name: Multi Domain Redirect
' Description:If you have multiple domai
' n names pointing to the same web site, t
' his code will allow you to redirect the
' user to a subdirectory based on the web
' address then type in the browser.
' By: Glenn C.
'
'
' Inputs:None
'
' Returns:None
'
'Assumes:None
'
'Side Effects:None
'This code is copyrighted and has limite
' d warranties.
'Please see [линк]
' e.com/xq/ASP/txtCodeId.6349/lngWId.4/qx/
' vb/scripts/ShowCode.htm
'for details.
'**************************************

<%@ Language=VBScript %>
<%
' Set up your variables
Dim sURL, sPath
' Get the domain name typed in the brows
' er.
sURL = Request.ServerVariables("HTTP_HOST")
' Get the rest of the path after the dom
' ain name.
sPath = Request.ServerVariables("PATH_INFO")
' Based on the domain name, redirect the
' user
' to the correct directory and attach th
' e rest
' of the path.
Select Case sURL
Case "[линк]", "maindomain.com"
' Ignore...this is the current site.
Case "[линк]", "domain2.com"
' redirect to the "domain2" directory
Response.Redirect "domain2" & sPath
Case "[линк]", "domain2.net"
' redirect to the "domain2net" directory
'
Response.Redirect "domain2net" & sPath
End Select
%>

Отговор
в отговор на stan #2

Re: domain redirect script

Немога да разбера какво точно ти трябва, но...

За да използваш този скрипт трябва да имаш регистрирани няколко домейна и да си ги настроил да сочат към едно и също място (IP или домейн). Примерно имаш [линк], [линк] и [линк] и те всичко сочат към един сайт...

Този код трябва да го сложиш или на всяка страница или пък в global.asa файла. Трябва да Select Case statement-а да отговаря на твоите нужди... Примерно може да изглежда така:

Select Case sURL
Case "[линк]", "domain1.com"
' Ignore...this is the current site.
Case "[линк]", "domain2.com"
Response.Redirect "[линк]" & sPath
Case "[линк]", "domain3.com"
Response.Redirect "[линк]" & sPath
End Select

Епа, това е моето хоби... [линк]
Отговор