Fix Canonical Issues with .htaccess2021-04-09T18:47:04+00:00

Fix canonical URLs with Apache .htaccess files.

In both Yahoo and Google, canonical URLs can sometimes become an issue. A canonical URL issue is one where the search engine has to figure out that several different URLs are actually the same page and which one of those URLs is the best one to index. Unfortunately, the search engines frequently are unable to do this correctly without some help from the site owner.

The best way to make sure that you don’t have a canonical issue is to fix canonical URLs before the search engines find them. The most common canonical URL potential problem is the www versus the non-www version of your website.

To a search engine, http://www.example.com and http://example.com are two different URLs with the exact same content. The search engines will suppress one version or even both versions because, as far as they are concerned, they are duplicate content. If search engines index all of the page on your site like this, your site could suffer serious rankings loss in the search results.If your website runs on a Unix server (or a *nix server with Apache), you can fix canonical issues by redirecting with .htaccess files. You simply will be redirecting the non-preferred version of your URLs to the preferred version.

How to use Apache .htaccess files for redirecting URLs.

In this example, we will be redirecting with .htaccess the non-www version to the www version.

Open your .htaccess file and add the following lines:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Save your .htaccess file and upload to your server. Canonical redirecting with .htaccess is just that easy.

Still having issues with canonical URLs? Check out our free IIS tutorial, where we go through the steps to create a 301 redirect from a non-www URL to the www URL.

If you are having problems in Yahoo or Google, canonical or otherwise, contact the search engine experts at The Search Guru today to get started!

Recent Posts

  • drop in traffic and conversions

“We’ve acquired two competitors, but still organic traffic and revenue keep dropping over the last 12-18 months” [Lessons from Work Sessions Series]

March 15th, 2021|Comments Off on “We’ve acquired two competitors, but still organic traffic and revenue keep dropping over the last 12-18 months” [Lessons from Work Sessions Series]

We hadn’t had a work session with this team since the first US pandemic lockdown, over a year ago. Maybe that’s why when the Zoom participants started showing on my screen, I imagined them in

Top 9 Fastest Ways to Win Leads and Sales via B2B Content Marketing (even when Resources are Limited) for 2021

January 17th, 2021|Comments Off on Top 9 Fastest Ways to Win Leads and Sales via B2B Content Marketing (even when Resources are Limited) for 2021

The pandemic compounded every content marketer’s #1 problem: lack of time and resources.  Top content marketers, when faced with crisis, revisit strategies. They take uncertainty, disruption, changing customer behavior and other complexities and assess