Canonical Tag Implementation

Canonical Tag Implementation



Canonical Tag


Code used by search engine crawlers/spiders to tell search engines what URL is the original version of your webpage.

Canonical Tag Implementation

Custom 404 Pages


404s can appear if a URL is mistyped, a search engine link is out of date, or if a link on the site is broken. You want to create a custom 404 page that will not confuse your readers so they can easily be redirected back to your site.

A 404 page should include a link back to the home page or site map of your website so users can quickly get back to what they were searching for. A search box, if you have a site search, is also a good idea to add to a 404 page. Other than that, keep the page minimal, remove distractions and get the user off the 404 error page as quickly as they got on.

Keep in mind most users may not be so savvy when it comes to the use of a custom 404 page and other Internet jargon so simple explanations in English are key! Although, keeping it minimalist does not have to mean "boring" when it comes to the use of a custom 404 page. The steps to make a custom 404 page are simple and this site can explain in detail how to create one depending on your server. By following these steps, even the most novice individual can achieve success in the development of a custom 404 page.

301 Redirects


If you have old pages on your website that you want to remove or rename, use a 301 redirect to preserve search engine rankings and pass on backlinks and/or page rank. You can even redirect whole websites to new ones through the use of 301 redirects. The use of 301 redirects is easy to do and is very search engine friendly.

The term "301" stands for "moved permanently." 301 redirects are created by using a .htaccess file. Follow this guide to learn how to implement many different types of 301 redirects. When pages are deleted instead of redirected with a 301, they turn into 404s Not Found Pages.

301 non-www to www


From what I can tell Google has yet to clean up the canonicalization problem that arises when the www version of your site gets indexed along with the non-www version (i.e. http://www.seoappoint.com & http://seoappoint.com).

<code>
RewriteEngine On

RewriteCond %{HTTP_HOST} ^seoappoint.com [NC]
RewriteRule ^(.*)$ http://www.seoappoint.com/$1 [L,R=301]
</code>


The '(*.)$' says that we'll take anything that comes after http://seoappoint.com and append it to the end of 'http://www.seoappoint.com' (thats the '$1' part) and redirect to that URL. For more grit on how this works checkout a good regular expressions resource or two.

Note: You only have to enter 'RewriteEngine On' once at the top of your .htaccess file.

Alternately you may choose to do this 301 redirect from
in the Apache config file httpd.conf.

<code>
<VirtualHost 67.xx.xx.xx>
ServerName www.seoappoint.com
ServerAdmin info@seoappoint.com
DocumentRoot /home/seoappoint/public_html
</VirtualHost>

<VirtualHost 67.xx.xx.xx>
ServerName seoappoint.com
RedirectMatch permanent ^/(.*) http://www.seoappoint.com/$1
</VirtualHost>
</code>


Note that often webhost managers like CPanel would have placed a 'ServerAlias' seoappoint.com in the first VirtualHost entry which would negate the following VirtualHost so be sure to remove the non-www ServerAlias.

301 www to non-www


Finally the www 301 redirect to non-www version would look like:

<code>
RewriteCond %{HTTP_HOST} ^www.seoappoint.com [NC]
RewriteRule ^(.*)$ http://seoappoint.com/$1 [L,R=301]
</code>


Redirect All Files in a Folder to One File


Lets say you no longer carry 'Best Travel Deal' and hence want to redirect all requests to the folder /besttraveldeal to a single page called /new-offer.php. This redirect can be accomplished easily by adding the following your .htaccess page:

<code>
RewriteRule ^besttraveldeal(.*)$ /new-offer.php [L,R=301]
</code>


But what if you want to do the same as the above example EXCEPT for one file? In the next example all files from /besttraveldeal/ folder will redirect to the /new-offer.php file EXCEPT /besttraveldeal/tours.html which will redirect to /indiatours.html

<code>
RewriteRule ^besttraveldeal/tours.html /indiatours.html [L,R=301]
RewriteRule ^besttraveldeal(.*)$ /new-offer.php [L,R=301]
</code>


Redirect a Dynamic URL to a New Single File


It's common that one will need to redirect dynamic URL's with parameters to single static file:

<code>
RewriteRule ^article.asp?id=(.*)$ /seoservices.html [L,R=301]
</code>


In the above example, a request to a dynamic URL such as http://www.seoappoint.com/article.jsp?id=8932
will be redirected to http://www.seoappoint.com/seoservices.html

0 comments: