homepage Welcome to WebmasterWorld Guest from 54.166.255.168
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
rel="canonical" tag
Question about proper use
Liane

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4632838 posted 11:15 am on Dec 22, 2013 (gmt 0)

I cannot get htaccess and do not have a 301 redirect for my site, I was advised to use a rel="canonical" tag on each page of my site. I am using HTML 4.01.

To answer two questions before someone asks:

Yes, when I can afford it, the site will be updated probably to html 5.
I will also be changing hosts in the very near future.

So ... after having added the rel link, I read in a few threads and discovered that most people use a trailing forward slash in the url which I have not done. So my tags are all:

<link rel="canonical" href="www.mysite.com/product_large_blue_widgets.html" >

Do I need to go back and add the forward slash and should it simply be .html/" ?

 

JD_Toims

WebmasterWorld Senior Member Top Contributors Of The Month



 
Msg#: 4632838 posted 11:21 am on Dec 22, 2013 (gmt 0)

Do I need to go back and add the forward slash and should it simply be .html/" ?

No, not at all -- You just use the "main" URL for your content in the href part, so what you have is fine, with one exception: You need the protocol [http://] at the beginning, so it's an absolute URL.

<link rel="canonical" href="http://www.example.com/product_large_blue_widgets.html" >

Liane

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4632838 posted 11:39 am on Dec 22, 2013 (gmt 0)

Yes, the http is there already. So I am good to go! Yeah.

Many thanks for the input! :)

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4632838 posted 11:55 am on Dec 22, 2013 (gmt 0)

trailing forward slash in the url

Are you positive you're not thinking of xhtml grammar, where every element has to be closed? Then it would be
<link rel="canonical" href="http://www.example.com/product_large_blue_widgets.html" />
but in html there's no slash.

HTML 4 is fine. You can start adding HTML 5 pieces as you go along; you don't have to change in one fell swoop. But if anyone says you should have been using XHTML for the past ten years, just put your fingers in your ears and hum loudly. Works for me :)

And yes, if you don't have full control of your own htaccess file it is time to change hosts.

Liane

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4632838 posted 12:26 pm on Dec 22, 2013 (gmt 0)

Hi Lucy,

I am not positive about anything right now. My site has taken a huge nose dive in the rankings and it was also hacked for a second time ... despite doing everything the host told me to do security wise.

One of the very kind members here is helping me, but he is very busy, so am struggling along as best I can and reading as much as I can in between receiving his advice. It's a slow process.

I have made a lot of changes to the site and am updating as I go along. Crossing my fingers that all this works! :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved