WebFaction
Community site: login faq

I have an asp redirect based on domain name scrip but need it in hp

<%
Select Case Request.ServerVariables("HTTP_HOST")
Case "domane1.com", "domane1.com"
  destURL = "http://domane1.comt:8053"
Case "domane2.com", "www.domane2.com"
  Response.Redirect "http://domane2.com/index1.html"
End Select
%>
<html>
  <frameset cols="0,*" framespacing="0" border="0" frameborder="0">
    <frame name="zero" scrolling="no" noresize>
    <frame name="main" src="<%=destURL%>">
  </frameset> 
</html>

as you can see one domain goes to a web page but the ather one terns in to a iframe I need this same fonchin in a php format

asked 23 Jan '13, 10:50

cbranca
312
accept rate: 0%

edited 23 Jan '13, 14:17

seanf
12.2k41836


Something like this should do it:

<?php
switch($_SERVER["HTTP_HOST"])  {
    case "domane1.com":
    case "www.domane1.com":
        $destURL = "http://domane1.comt:8053";
        break;        
    case "domane2.com":
    case "www.domane2.com":
        header("Location: http://domane2.com/index1.html");
        exit;
}    
?>
<html>
    <frameset cols="0,*" framespacing="0" border="0" frameborder="0">
        <frame name="zero" scrolling="no" noresize="noresize">
        <frame name="main" src="<?php echo $destURL ?>">
    </frameset> 
</html>
permanent link

answered 23 Jan '13, 14:27

seanf
12.2k41836
accept rate: 37%

edited 23 Jan '13, 16:28

ok got it to werk after reseting my cash

(23 Jan '13, 17:00) cbranca

The script in my answer was not generated; it was hand-written, just for you :)

If you're a WebFaction customer, feel free to log into our control panel and open a support ticket, and we'll be happy to assist you with the error.

(23 Jan '13, 17:04) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×128
×76
×5
×2
×1

question asked: 23 Jan '13, 10:50

question was seen: 6,558 times

last updated: 23 Jan '13, 17:04

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM