Forum Moderators: Robert Charlton & goodroi
We can not set it up the right way using IIS. The only we could do it is split the traffic which could cause duplicate issues with Google.
I was wondering if it's OK, to redirect the "no www" of every page back to the home page?
>> We can not set it up the right way using IIS.
301 Redirect "no-www" to "with-www" on IIS1. 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
5. IMPORTANT:
Check the box "A permanent redirection for this resource." Otherwise
you get a 302 redirect instead of a 301.
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.
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
<%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)
End If
' 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
end if
' Send 301 response and new location
Response.Clear
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", theURL
Response.Flush
Response.End
end if
%>
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?
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..
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.
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!
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.
Anyhow, I'm sure my query is too dumb to worry about!