Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is <a href="example.com/page.php#page" rel="noindex, nofollow"> correct?

Tags:

html

In my site I have the page http://www.example.com/page.php , however, I have links leading to http://www.example.com/page.php#page so I want them not to be indexed or followed. Will it be correct to mark these links as

<a href="http://www.example.com/page.php#page" rel="noindex, nofollow"> 

Also, as a canonical meta tag on the same page I already have

<link rel="canonical" href="http://www.example.com/page.php" /> 

Thank you!!!

P.S: I ask if this syntax is right, not how Google works and what is its politic towards urls

like image 393
Dimentica Avatar asked Feb 13 '17 20:02

Dimentica


People also ask

What is HREF in PHP?

The href attribute specifies the URL of the page the link goes to.

How do I link a page to another page in PHP?

We can use Anchor tags to Link a Submit button to another page in PHP. We need to Write/Declare Submit button between Anchor tag's Starting and Closing tags. By using Anchor tag's href=”” attribute we can give a Path where we want to Link our Submit Button.

What is a hyperlink example?

Alternatively referred to as a link and web link, a hyperlink is an icon, graphic, or text that links to another file or object. The World Wide Web is comprised of hyperlinks linking trillions of pages and files to one another. For example, "Computer Hope home page" is a hyperlink to the Computer Hope home page.

How do I link two HTML pages together?

To make page links in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the link starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a link. Add the URL for the link in the <a href=” ”>.


1 Answers

You have invalid syntax in "rel" attribute. It must contain list of white-space separated keywords - remove the comma.

The "nofollow" keyword is correct. The "noindex" keyword does not make sense.

Edit: Clarification on request.

Proper syntax would be

<a href="http://www.example.com/page.php#page" rel="noindex nofollow">

But having "noindex" on the link does not make sense because this keyword obviously pertains to the linked page so it must be defined there for the whole page (in target's page's meta tag or robots.txt). There can be many links pointing to that page and SE would not know which link is right to claim "noindex" on target page...

like image 182
elixon Avatar answered Nov 15 '22 04:11

elixon