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

一世执手 提交于 2019-12-06 12:59:42

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

If you have access to your domain registrar you can change the CNAME record to point to the correct domain. This is the same thing as setting up a sub domain using DNS but in this case wwww or w both point to www on your website. From a design point of view you are also offloading the work of the redirect to another server.

Try using the Live HTTP Headers plugin for Firefox to examine the headers the server sends back to you. If Live HTTP Headers reports a 301 redirect, try capturing the user agent on the server side and change your Firefox to use that user agent. If you still get a 301 redirect, you will have to examine the server more closely to see if the request from SEO Consultants is reaching the code around the redirect.

You can also try using IIS and adding a bunch of redirection websites that respond to the w, ww, and wwww subdomains instead of using global.asax and redirection there.

If you have access to a Unix-type box, you can type this to see the returned headers:

curl -I ww.site.com

But I'd trust Firebug if I were you.

Might try using IIS instead just to see if that quells the SEO tools.

Use Fiddler to directly view the headers being sent back from the web server (and much much more - Fiddler is a tool that every web developer should have on hand, and it's free).

Google Webmaster Tools will report on 404's and other errors that Google hits while crawling your site. You can also set your preferred canonical domain name format (www.site.com vs. site.com).

Google is only going to "see" one of your redirects from a malformed URL (e.g. from w.site.com to www.site.com) if a malformed link actually exists somewhere that Google would attempt to crawl. I suppose you could put some test links somewhere unobtrusive on your site, check Google Webmaster Tools to see what Google does when it crawls those test links, and then delete the test links when you're satisfied with the results. Google's crawls are non-deterministic, so you might have to wait weeks before Google crawls those test links.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!