Winhost equivalent of CPANEL's URL redirect

Discussion in 'General troubleshooting' started by baselinej, Aug 6, 2012.

  1. I'm a first time user of ASP hosting and was looking for the Winhost equivalent of CPANEL's URL redirect.

    Under (UNIX-based) CPANEL for my PHP webhosting account, I could set all internal and external requests to 'firefightersonline.com' to be redirected to 'firefightersonline.com/public' so that all the relative references (i.e. my INCLUDE statements would be relative to the redirect of 'firefightersonline.com/public', eg. 'firefightersonline.com/public/scripts/script.asp'

    How do I accomplish this? Support has sent me the usual KB on subdomain redirects as well as parent path but this does not appear to be the issue.

    I created a new file called 'Winhostdefault.asp' put it in the root folder with the following code:

    <%
    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("www.firefightersonline.com") ) > 0 Then
    Response.Redirect("/public")
    ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("firefightersonline.com") ) > 0 Then
    Response.Redirect("/public")
    End If
    %>

    Then when I type 'www.firefightersonline.com' the site does not redirect to /public, instead it shows the root folders.

    When I click on 'Winhostdefault.asp', I get:

    "Active Server Pages error 'ASP 0126'
    Include file not found

    /public/default.asp, line 18

    The include file '/include/subs.asp' was not found."

    Anyone encounter the same problem? (I see a few people trying to do subdomains or multiple domains for the one webroot - this is not what I'm trying to do. I just my one domain to work out of the /public directory)

    Many thanks
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015

Share This Page