Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/10/2013, 13:09
consultorensistemas1
 
Fecha de Ingreso: octubre-2013
Mensajes: 2
Antigüedad: 10 años, 7 meses
Puntos: 0
Pregunta redireccion con php

Buenas tardes tengo un inconveniente que ojala me puedan ayudar a solucionar .
Mi jefe me a dado un script que trabaja sobre un servidor windows para redireccionar un dominio a un subdominio para una pagina replica de un programa de multinivel debo pasarlo a php por que mi servidor es linux



mi servidor es externo y me hacen la siguiente aclaración

Si la redirección se hace desde un servidor externo, la constante REDIRECT_URL debe incluir el nombre de dominio (ej. REDIRECT_URL = “http://mi.dominio.com/rs_frn_get_url.asp?RWP”)



Dim ScriptPath, HostURL
Const REDIRECT_URL = "/rs_frn_rwp_get_url.asp?RWP"

If AllowRedirect Then
If (InStr(1,REDIRECT_URL,"://") = 0) Then ' Direccion relativa, usamos el mismo host
Response.Redirect HostURL & REDIRECT_URL & ScriptPath
Else ' Direccion absoluta
Response.Redirect REDIRECT_URL & ScriptPath
End If
Else
With Response
.Status = "404 Not Found"
.Write "<span style=""font-family:Verdana,Arial;font-size:12px;""><b>404</b> Object not found: <i>" & ScriptPath & "</i></span>"
.End
End With
End If
'================================================= ===============
' Evalua si es necesario redireccionar o solo enviar el http code
'----------------------------------------------------------------
Function AllowRedirect()
Dim LnToken

HostURL = Mid(Request.ServerVariables("QUERY_STRING"),5) '404;http;//...
LnToken = Instr(9, HostURL, "/") 'https://www... o http://www...
If (LnToken > 0) Then
ScriptPath = Mid(HostURL, LnToken)
HostURL = Left(HostURL, (LnToken - 1))
Else
ScriptPath = ""
End If
AllowRedirect = ((InStr(2,ScriptPath,"/") = 0) And (InStr(1,ScriptPath,".") = 0))
End Function
%>