{"id":24,"date":"2006-08-22T11:08:08","date_gmt":"2006-08-22T11:08:08","guid":{"rendered":"http:\/\/ramblingsofasysadmin.com\/blog\/?p=24"},"modified":"2006-08-22T11:08:08","modified_gmt":"2006-08-22T11:08:08","slug":"resolving-canonical-issues-with-plesk","status":"publish","type":"post","link":"https:\/\/ramblingsofasysadmin.com\/?p=24","title":{"rendered":"resolving canonical issues with plesk."},"content":{"rendered":"<p>in the world of SEO (search engine optimization), there is an unwritten rule (well, it will be written sooner or later) that you can&#8217;t have duplicate content on google search engines from the same site.  this means that http:\/\/www.domain.com and http:\/\/domain.com cannot both be found by search engines.  you must choose one or the other or you may face a penalty.<br \/>\nthere&#8217;s an easy solution for this using vhosts in plesk.  the only not-so-user-friendly part about this that you have to do it for every domain you are worried about, and with 100+ domains, you&#8217;ll be making 100+ (or 200+ files if you have SSL  support as well) vhost files for each domain.<br \/>\nin any event, this is how it&#8217;s done.<br \/>\nnavigate on your plesk server to your domain&#8217;s conf directory.  on some machines, it&#8217;s<br \/>\n<font face=\"courier\"># cd \/var\/www\/vhosts\/domain.com\/conf<\/font><br \/>\ni prefer going through this shortcut:<br \/>\n<font face=\"courier\"># cd \/home\/httpd\/vhosts\/domain.com\/conf<\/font><br \/>\nregardless, both are symbolically linked &#8212; or they should be in certain setups.<br \/>\ncreate the file <font face=\"courier\">vhost.conf<\/font><br \/>\n<font face=\"courier\"># vi vhost.conf<\/font><br \/>\nadd the following to the vhost.conf file<br \/>\n<font face=\"courier\">RewriteEngine On<br \/>\nRewriteCond %{HTTP_HOST} !^www\\. [NC]<br \/>\nRewriteRule ^(.*)$ http:\/\/www.%{HTTP_HOST}$1 [QSA,R=301,L]<\/font><br \/>\nfor domains with SSL support, you will need to create a file called <font face=\"courier\">vhost_ssl.conf<\/font> as well.<br \/>\n<font face=\"courier\"># vi vhost_ssl.conf<br \/>\nRewriteEngine On<br \/>\nRewriteCond %{HTTP_HOST} !^www\\. [NC]<br \/>\nRewriteRule ^(.*)$ https:\/\/www.%{HTTP_HOST}$1 [QSA,R=301,L]<\/font><br \/>\nthat&#8217;s it!  now, run this plesk command to process your update.<br \/>\n<font face=\"courier\"># \/usr\/local\/psa\/admin\/bin\/websrvmng -av<\/font><br \/>\nload your page in your preferred web browser as http:\/\/domain.com.  it will automatically redirect to http:\/\/www.domain.com and will be reflected in search engines with the www prefix only.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>in the world of SEO (search engine optimization), there is an unwritten rule (well, it will be written sooner or later) that you can&#8217;t have duplicate content on google search engines from the same site. this means that http:\/\/www.domain.com and http:\/\/domain.com cannot both be found by search engines. you must choose one or the other or you may face a penalty. there&#8217;s an easy solution for this using vhosts in plesk. the only not-so-user-friendly part <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/ramblingsofasysadmin.com\/?p=24\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":0,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"wp:attachment":[{"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ramblingsofasysadmin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}