Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
hello all, Tanja's post about SEO and duplicate content made me think about the subject ... I specify a preferred non-www domain via my Google Webmasters account and include a 301 redirect in the htaccess file from www to non-www.

I was looking at this http://www.mattcutts.com/blog/seo-advice-url-canonicalization/ and the advice from Matt Cutts is to consistently refer to either www or non-www links. But using cms:link gives me the www version - so I have a mixture. Is it feasible to suppress the "www" output by the Couch tag cms:link so that all the URLs are non-www?

I prefer non-www as the use of www seems like a dead weight these days.
hi potato,

maybe you know this already, I just have read somewhere that
the changes or instructions done through Google Webmaster will affect only Google, not other machines like Bing, Yahoo etc...

Would you know what these two lines from our couch gem_htacces.php file actually do, except that they apperantly make some kind of synch with the kind of chocies that you mentioned?

#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


I do not know if this relates to your post, I was just curious if this has something to do with how couch will output cms:link

best
Tanja

p.s. ok, I just figured out, this would make 301 redirect from the non-www to the www version of domain, or????? Anyway, an explanation from you couch experts on this is much appreciated

Thanks
hi Tanja - there was a recent post about those lines in the htaccess file with comments from KK - but I can't find it! It's there somewhere.

SEO can be such a minefield - I try to follow best practice as far as possible - though it sometimes is a bit like trying to hit a moving target.
@potato
Is it feasible to suppress the "www" output by the Couch tag cms:link so that all the URLs are non-www?

Sure. Please specify the non-www version of your site's URL in config.php as follows and Couch will use that for all links.
// 1.
// If neccesary, define the full URL of your site including the subdomain, if any.
// V.IMP: Don't forget the trailing slash!
define( 'K_SITE_URL', 'http://yoursite.com/' );


@Tanja
p.s. ok, I just figured out, this would make 301 redirect from the non-www to the www version of domain, or????? Anyway, an explanation from you couch experts on this is much appreciated

You are right - that part of .htaccess redirects the visitor to the www version of the URL if a non-www link is used to access a page.

The logic is to ensure only a single version (the www one in this case) of all links are used.
If you wish to use a non-www version as the default, the rules can be tweaked as follows (along with using the config setting mentioned above) -
Code: Select all
RewriteCond %{HTTP_HOST} ^www\.(.*)
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Hope this helps.
ah yes - should have thought of that - thanks KK!
Thanks for explaining this KK! yes it helps!
and thanks potato for starting this thread, this clarified for me some things in couch i did not think of...

best regards

Tanja
Just want to say thank you! I've been grappling with .htaccess since last night and this thread finally helped me achieve removal of my www, and realize how to support this in my config file, too. Fantastic!
7 posts Page 1 of 1
cron