Because of this, Google has index 2 copies of all of my pages - the template pages and the non-template pages.
If I search for this in the google search box: sitename:mysite.com
I see all of the pages that google has index.
I could have prevented google from indexing the 'showtemplate=flase' versions of my pages by including this in my .htaccess file:
Code: Select all
# Stop SERPs from indexing 'showtemplate=false' pages
#modify query string condition here to suit your needs
RewriteCond %{QUERY_STRING} (^|&)showtemplate=false [NC]
#set env var MY_SET-HEADER to 1
RewriteRule .* - [E=MY_SET_HEADER:1]
#if MY_SET_HEADER is present then set header
Header set X-Robots-Tag "noindex" env=MY_SET_HEADER