It sounds like a recipe for disaster to me. I would not encourage that approach.
>> We can not set it up the right way using IIS.
|301 Redirect "no-www" to "with-www" on IIS |
1. Assuming that www.example.com is already set up as a "website",
go into Internet Services Manager and also set up example.com
(no www) as a website.
2. In Internet Services Manager select the new example.com website
and go into Properties.
3. Under the Home Directory tab, change the option button
"When connecting to this resource the content should come from"
to "A redirection to a URL".
4. Enter the URL as http://www.example.com
Check the box "A permanent redirection for this resource." Otherwise
you get a 302 redirect instead of a 301.
I can't comment on the rank/positioning effects of doing the 301 and redirect to homepage, but it seems that it could be a pain for visitors.
When you say "We can not set it up the right way using IIS", are your pages in html only then? if they are php, asp etc then you can include a global header or footer that does the redirect based on current URL.
I have one included in the top of my php pages (and old asp sites when I used to write them) called 'urlfix' that seems to do the trick.
If you use asp, i do suspect that you can write a script that would redirect all visitors to the www version of the url
I am going to have a go at it
Problem is, the last time I did this, its not happy with urls with variables after the "?"
it simply drops the variables,
Now, this may be a daft question but, does your redirection also operate on a user navigating your internal links?
from say index.htm to contactus.htm
Here's what I use on all asp pages, I set it up as an .asp page itself, then add an include. Transfers server variables and will work in subdirectories as well. No need to adjust for mydomain.com etc, it looks that up. I've got the www to non-www version as well if anyone is interested.
Dim Domain_Name, theURL, QUERY_STRING, HTTP_PATH,TEMP_NUM
'Get domain that the page is on
Domain_Name = lcase(request.ServerVariables("HTTP_HOST"))
'Check if URL is the www version
if left(Domain_Name, 3) <> "www" Then
HTTP_PATH = request.ServerVariables("PATH_INFO")
'Check if page is default.asp if so, redirect to "/". If other index page is used, such
'as index.asp the numbers in the right and len statement need to be changed, as well
'as the IF statment to indicate the index page.
If right(HTTP_PATH, 12) = "/default.asp" Then
TEMP_NUM = len(HTTP_PATH)-11
HTTP_PATH = left(HTTP_PATH,TEMP_NUM)
' Sets the new URL settings with correct page
QUERY_STRING = request.ServerVariables("QUERY_STRING")
theURL = "http://www." & Domain_Name & HTTP_PATH
'This section passes on the query string variables
if len(QUERY_STRING) > 0 Then
theURL = theURL & "?" & QUERY_STRING
' Send 301 response and new location
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", theURL
The problem is we have done a url rewrite through an ISAPI Filter.
For that reason our site is much too complicated for it to work with the codes above.
Any other suggestions?
The reason that redirecting all no-www urls to the Home Page would be a disaster is that you would be creating a massive duplicate content situation. The issues and solutions have been pretty well presented here. You may need to change your approach -- it sounds like you've painted yourselves into a techical corner,
tedster, I still don't understand where the duplicate content comes from.
Redirecting from non-www to www (specific page) with a 301 is the generally recommended way to fix duplicate content. In that case you have one URL with a 301 and one URL with a 200. If redirecting all to www home page then you have multiple URLs with 301 and still only one URL with a 200.
Are you saying that multiple 301s to a single URL counts as duplicate content?
RE: Are you saying that multiple 301s to a single URL counts as duplicate content?
I have the same question. I am removing a few hundred category pages and want to 301 redirect to one main category page? All of this is done on-domain. But is this a red flag? I don't care if these pages appear in the main index or not.. I just don't want them spidered, indexed etc..
"RE: Are you saying that multiple 301s to a single URL counts as duplicate content?"
Kindly respond to this..
I'm wrong -- that should teach me to post when I'm exhausted. No duplicate content probem here. That would only happen if you used 302, but not with 301.
The issue is that the Home Page cannot be the "new location" for all those no-www urls. So set the 301 to point to the with-www version of each url, not the home page. Google knows that "301 networks" are a current spamming tool and misused 301 redirects are not a healthy thing to do for your site's future stability.
After mulling this topic over, I think what is being said is that it's safer to 404 these pages, whereas if you 301 them to a single page, the SE's may look at this technique as doorway page spamming (if all of you removed pages were in the main index), versus just a site clean up (which is what your intention likely was). Just my opinion though
Having too many 404 errors is not a problem with the search engine?
If you porperly serve the 404 error document for the dropped pages, the bots will get it, and drop those pages. Too many dropped pages too soon could be risky [insert red flag here], but that would happen either way, whether you 404'd them or 301'd them. Maybe do it in batches and incrementally if you can so the changes are not overwhelming and drastic. You could also use your robots.txt to tell the bots to stop trying to index/re-index the dropped pages and until they do actually get dropped.
I see the "many to one" type of redirect as potentially flagging a site as "trying something on".
It isn't reasonable that thousands, or even just dozens, of different content pages have all been merged to now be at one single new URL.
Being that we are having difficulties to redirect non www to www, would you prefer rather show a 404 error page than redirecting to one url?
My problem is the opposite to the familiar one here: I want to find a way to redirect from www-pages to non-www pages. My server interface lets me do it round the other way, but not the way I want.
I actually don't want to use www (if microsoft don't need them, can't see why I should).
But I don't know how!
It doesn't matter what page you show, what matters is the http response code in the server header. But yes, I'd say a 404 would be better. Not good, mind you, but better.
Do you run your own server or at least have a dedicated hosting account? I would not suggest trusting a sigificant business site to shared Window hosting -- at least not if even one person's livelihood depends on it. Some things are worth the investment, and solid e-commerce hosting is one of them, IMO.
Brian, check out our forum for whatever kind of server you are running, Microsoft IIS [webmasterworld.com] or Apache [webmasterworld.com].
Hi Tedster. Thanks for that. At the Apache posts there is some text examples, but I can't make head nor tail of the relevant one. I assume I cut and past into an HT file, like I did for something else (404 I think), but I can't quite see exactly what.
Anyhow, I'm sure my query is too dumb to worry about!