News
Which is more important, driving traffic to your website or encouraging as many people as possible to see your content? Believe it or not, they are not one and the same.Too often, we as website owners live and die by web analytics applications. We fret about bounce rates, unique visitors and dwell time.
17 November 2010
Do our bytes look big in this?
23 August 2010
For those of us who can't make it to Switzerland for the skiing season.
19 July 2010

Our Services

Check out our many services.

Our Clients

Don't forget to check out clients and the projects we built with them.

Case Studies

Check out our featured case studies, including project details, testimonials, screen shots and videos for clients such as KORA, BOC, My Ears, and Laing+Simmons.

My Staging Server has Been Indexed in Google for my ASP.NET Website – Help!

Tuesday 19th of February 2008 05:08:46 PM

We had this problem recently with a client who linked to their staging server before the site was live. Because the staging server had a separate IP from the live site, the staging server got indexed in Google instead of the domain.

The solution is to use a 301 redirect to make sure all requests for the staging server are permanently redirected on the HTTP request level. This is quite simple to do on the Apache webserver – you can simply add a redirect handle to your .htaccess file. However, if you’re on shared ASP .Net hosting (a.k.a. IIS) and you don’t have access to the IIS control panel this quickly becomes a pain. The solution is to check the referring domain on server event startup (i.e. before a session is initialised) using a global.asax operation. Here is a small C# script to add to your global.asax file which will allow you to perform this task.

if (Request.ServerVariables[“SERVER_NAME”].Contains(“Staging_Server_Name”))
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”, “Domain_Name”");
}

All new requests for your staging server will now be redirected to your domain. You might also like to submit a sitemap and “resubmission” request via the Google webmaster console.







            

Blog Terms