How do I add the rel code to specify my canonical (preferred) URL in the Premium Website Builder?

Asked by:
Web Profit Experts / 5 Points
Time:
2011-11-16 4:43 pm EST
Category:
How To
Hits:
952
Canonicalization is a big problem for SEO. That is where some links go to the www version of your website and some go to the non-www version. There is a rel code for canoncializing your site.

How would I add this custom rel code to my site?

Thanks.

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff

0

ChristiNi
Staff
13,688 Points
2011-11-16 5:19 pm EST
Hi,

Great question! I see you're using the Premium Website Builder. Normally the rel tag is placed between the <head> tags, but that would require manual editing of your site files and would be overwritten if you ever republished your site from the builder.

A much more efficient way to handle this would be to force everything to go either go through www or non-www using your .htaccess file.

You can redirect the non-www domain over www by adding this to your .htacess file.

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

Alternatively you can go the other direction and redirect www over non-www by adding this to your .htaccess file instead:


RewriteEngine on
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.org$ [NC]
RewriteRule ^(.*)$ http://yourdomain.org/$1 [R=301,L]

You can edit your .htaccess file using the File Manager in cPanel. Make sure you select the option to "Show Hidden Files" when opening the File Manager.

Please let us know if you have any questions or need any additional assistance.

Regards,

Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.