Smack Posted August 18, 2010 Report Share Posted August 18, 2010 Ok - after a long absence I thought I would start working on my family history site again.I'll post this in the feature request section as well (is there one now?), but I'd like to know if anyone is doing anything with URL canonicalization with TNG? I did a search a few minutes ago and didn't see anything.I'm sure most people probably set up their preferences using Google Webmaster Tools, but wonder if anyone has done anything beyond this?Also, it would be nice to be able to use the canonical link element from within TNG. Quote Link to comment Share on other sites More sharing options...
Kimon Posted August 18, 2010 Report Share Posted August 18, 2010 Ok - after a long absence I thought I would start working on my family history site again.I'll post this in the feature request section as well (is there one now?), but I'd like to know if anyone is doing anything with URL canonicalization with TNG? I did a search a few minutes ago and didn't see anything.I'm sure most people probably set up their preferences using Google Webmaster Tools, but wonder if anyone has done anything beyond this?Also, it would be nice to be able to use the canonical link element from within TNG.Why should there be a change in TNG when you can simply edit your .htaccess file to do that?RewriteEngine onRewriteCond %{HTTP_HOST} ^domain\.tld [NC] RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L] Quote Link to comment Share on other sites More sharing options...
arnold Posted August 18, 2010 Report Share Posted August 18, 2010 Why should there be a change in TNG when you can simply edit your .htaccess file to do that?RewriteEngine onRewriteCond %{HTTP_HOST} ^domain\.tld [NC] RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L] As many people here on the TNG Forum do not know what a .htaccess file is, it would be helpful to explain what it does, where it is located, and emphasize that htaccess file must be preceded by a dot.Arnold Quote Link to comment Share on other sites More sharing options...
Kimon Posted August 18, 2010 Report Share Posted August 18, 2010 As many people here on the TNG Forum do not know what a .htaccess file is, it would be helpful to explain what it does, where it is located, and emphasize that htaccess file must be preceded by a dot.Arnoldok....The .htaccess file is a directory level configuration file found mainly on Apache webservers.The configuration settings above with comments#turn on Apache's rewriting module to modify URLsRewriteEngine on#define the condition to look for. #In this case, we're looking to see if the host of the URL starts with "domain.tld" and doesn't have anything before that, like "www."RewriteCond %{HTTP_HOST} ^domain\.tld [NC] #if the criteria set by RewriteCond have been met, then this is the rule to apply#in this case: change from "domain.tld" to "www.domain.tld" and tell the browser that it's a permanent change (code 301)RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301,L] Quote Link to comment Share on other sites More sharing options...
Smack Posted February 5, 2011 Author Report Share Posted February 5, 2011 Thanks Kimon. I had forgotten about that.It worked perfectly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.