+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Location
    Chepstow, UK
    Posts
    78

    Default Domain aliases and 301 redirects

    As search engines aren't keen on the same content being on multiple domain names it would be nice if a 301 redirect could be put in place on domain aliases instead of having to add another domain (and losing one of my domain resourses) and setting that up for a 301 redirect.

    This isn't the end of the world as I'm not near my limit, but it just came to mind and I thought I'd share my thoughts with you all

    Rich

  2. #2
    Join Date
    Mar 2007
    Location
    Cardiff, UK
    Posts
    459

    Default

    There are ways to do a 301 redirect from an alias to a main domain.
    I use a global.asa file on my main domain to do this for my asp sites:

    Code:
    <script language="VBScript" RUNAT="SERVER">
    Sub Session_OnStart
      Dim strHost
      strHost = LCase(Request.ServerVariables("HTTP_HOST"))
      If Not strHost = "www.main-domain.co.uk" Then
      strHost = "www.main-domain.co.uk"
    
      Dim strScript, strQuerystring, strURL
      strScript = Request.ServerVariables("SCRIPT_NAME")
      strQuerystring = Request.ServerVariables("QUERY_STRING")
        If Not strQuerystring = "" Then
        strQuerystring = "?" & strQuerystring
        End If
      strURL = "http://" & strHost & strScript & strQuerystring
    
      Response.Status="301 Moved Permanently" 
      Response.AddHeader "Location", strURL
      End If
    End Sub
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts