Search code examples
asp.nethttp-status-code-301global-asaxcanonical-name

redirecting w., ww., wwww. to -> www


I'm trying to redirect site.com w.site.com ww.site.com and wwww.site.com to www.site.com.

My boss wants to ensure typos make it to the site as well.

They redirect fine. I'm using ASP.Net and throw a 301 redirect back using a regular expression, however, tools such as http://www.seoconsultants.com/tools/headers.asp don't seem to show a correct redirect when I try to use w.site.com ww. etc.

I'm trying to figure out what google sees, but I'm not sure where to check.

It would "appear" that firebug reports it as a 301, but I can't figure out why these tools are reporting back the wrong information. My boss is using web tools to see if these work, so does anyone know a way to prove that a 301 is being sent back correctly. Or can anyone recommend a way I can check for myself if a proper 301 is being returned?


Solution

  • Add a * A record to your dns entry. Yes that is an asterisk. This will cause anything that is not explicitly defined to go to that IP.

    For example: *.site.com