Using script to redirect after Domain Pointer

Discussion in 'Hosting Services / Control Panel' started by BarrySumpter, Jan 26, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi all (not just support),

    Web coding novice. VB6 software development professional.

    After a lot of research and communications with support. (i.e. support ticket has already been issued so please don't suggest I issue another.) I've purchased a Domain pointer, which has been setup properly by support.

    I have a www.myDomain.com up and running properly for months now.

    I've just purchsed www.myNEWDomain.com. I'vesetup the DSN and DiscountASP.net have setup my Domain Pointer for www.myNEWDomain.comto point to www.myDomain.com . Again, which is working properly.

    I would now like to redirect www.myNEWDomain.comto /mySubFolder when www.myNEWDomain.comgets redirected to www.myDomain.com .

    Its my opinion that my research indicates I should be able to do this.
    Its my opinion that I have been told by support I should be able to do this along with the Domain Pointer.
    ( i.e. http://community.discountasp.net/default.aspx?f=9&m=4674)
    (Which is why I purchased the Domain Pointer in the first place.)

    An example of the redirect coding to start with is located here:


    http://kb.discountasp.net/article.aspx?id=10102


    WHich I have modified to:


    <%


    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("MyNewDomain") ) > 0 Then


    Response.Redirect("/_MyPrivateFolder/myNewDomainSubFolder")


    ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("MyDomain") ) > 0 Then


    Response.Redirect("/_MyPrivateFolder/myDomainSubFolder")


    Else


    'don't do any redirect


    End If


    %>


    I continually receive a blank screen. No error. No under construction. Nothing.


    i've attempted to just:

    Response.write Request.ServerVariables("SERVER_NAME")


    and get the blank screen.


    I'm thinking that Request.ServerVariables("SERVER_NAME") will always be blank - for what ever reason.


    So perhapes there is another Request.ServerVariable that I sould be using instead.


    I just don't know which one.


    Or I'm mistaken about using the Domain Pointer in this manner.


    Or I'm mistaken about using redirect coding script in this manner.





    Specific, this is how, help would be greatly appreciated.


    Thanks all,


    Barry G. Sumpter


    P.S. I've already asked support to help withthis. Support has asked me to post here.
    (so please don't suggest I create a support ticket.)






















    Thanks,
    Barry G. Sumpter

    Post Edited (BarrySumpter) : 1/26/2005 10:21:43 PM GMT
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    The server variable should return the domain name.

    I created a test script and it returned the hostname fine.

    Try put this in your site

    <%

    Response.write Request.ServerVariables('SERVER_NAME')

    %>

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. This keeps comming up blank.

    Am I missing someting?

    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    </head>

    <%
    Response.write Request.ServerVariables("SERVER_NAME")
    %>
    </body>
    </html>

    Thanks,
    baz

    Thanks,
    Barry G. Sumpter
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    what is your domain name? i can run a test on the same server hosting your stie.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Thanks for that bruce

    I don't want my full web site name posted here to be picked up by web searchs so could you please go here

    www.mymembername.com

    exchanging mymembername with barrysumpter

    thanks dude







    Thanks,
    Barry G. Sumpter

    Post Edited (BarrySumpter) : 1/27/2005 12:51:43 AM GMT
     
  6. [​IMG] [​IMG] solutely Briliant!

    Thanks for the assistance here Bruce.

    The solution was the <% ... %> content must be saved in a .asp file.
    Just the <% ... %> code in the .asp file - nothing before and nothing after.

    For the redeirect to work, the file had to be named Index.asp (NOT Index.htm).

    I would suggest noteing this in the article.

    Two days for such a simple fix. What a waist of time.


    Thanks for the help Bruce.

    Looking foward to a better year!

    baz
     
  7. "Just the <% ... %> code in the .asp file - nothing before and nothing after."

    No Meta Data is needed either. Nor recognized by search engines.

    I was wondering why my Meta Data was not being pickedup.
    It was because I had it in my redirect Index.asp.

    Just place your meta data in the destination page instead.



    Thanks,
    Barry G. Sumpter
     
  8. DIM dns
    dns = Lcase(REQUEST.SERVERVARIABLES('SERVER_NAME'))
    SELECT CASE dns
    CASE 'mydomain1.com'
    response.redirect '/sub1/'
    CASE 'www.mydomain1.com'
    response.redirect '/sub1/'
    END SELECT
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page