Forum Moderators: Robert Charlton & goodroi
In all cases where pages are accessible with multiple URLs, 301 redirect to the "canonical" --or preferred-- URL. It is up to you to make sure that each page has only one URL by which it is accessible. For example, a recipe for trouble is a home page accessible at
example.com/
www.example.com/
example.com/index.php
www.example.com/index.php
This could potentially divide your PageRank and link popularity by four if people link to all of them.
How you do this 301 redirect depends on what server you're on -- Use ISAPI Rewrite for IIS or mod_rewrite for Apache.
A search of WebmasterWorld for "canonical domain" and "canonical URL" will turn up lots more info.
For a description, Google uses a "snippet" of text selected from the page that best matches the user's typed-in search terms. So you have two choices: Either make your description better fit your top search terms, or use the "nosnippet" attribute value in the on-page <meta name="robots"> tag. The first approach, if at all possible, is better.
Jim
Each port must have its own robots.txt file. In particular, if you serve
content via both http and https, you'll need a separate robots.txt file for each
of these protocols. For example, to allow Googlebot to index all http pages
but no https pages, you'd use the robots.txt files below.For your http protocol (http://yourserver.com/robots.txt):
User-agent: *
Allow: /For the https protocol (https://yourserver.com/robots.txt):
User-agent: *
Disallow: /[url=http://www.google.com/support/webmasters/bin/answer.py?answer=35302&query=https&topic=&type=]Webmaster Help Center
I feel the best practice is to set port 443 service on a dedicated subdomain, such as secure.example.com
That gives you two seperate domain roots with dedicated robots.txt files for each one. This avoids all kinds of potential chaos.
[webmasterworld.com...]
Also, for those on Windows servers but not using ISAPI Rewrite, you can do a page-specific workaround:
<%
'PUT THIS AT TOP OF PAGE
Response.Buffer = True
%><%
'FORCE PAGE TO BE NON SSL
Dim Domain_Name, theURL, QUERY_STRING, HTTP_PATH
Domain_Name = lcase(request.ServerVariables("HTTP_HOST"))IF Request.ServerVariables("SERVER_PORT")<>80 THEN
HTTP_PATH = request.ServerVariables("PATH_INFO")
If Left(HTTP_PATH, 8) = "/Default" Then
HTTP_PATH = ""
End If
QUERY_STRING = request.ServerVariables("QUERY_STRING")
theURL = "http://www.YOURDOMAIN.com" & HTTP_PATH
if len(QUERY_STRING) > 0 Then
theURL = theURL & "?" & QUERY_STRING
end if
Response.Clear
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", theURL
Response.Flush
Response.End
end if
%>