1

I can't work out how to get rid of the referrer that keeps getting appended to URL

My link

<a aria-label="Book" target="_blank" class="book-link" rel="noopener"` or `rel="noreferrer" href="<?=$site->book_link()->html()?>">...</a>

My meta

<meta name="referrer" content="no-referrer">

It keeps appending this and breaking links /&referrerUrl=https%3A%2F%2Fwww.mysite.com%2F

Burger Sasha
  • 187
  • 6
  • 17
  • 4
    If this didn't have a bounty, I'd vote to close as duplicate of [Multiple values for rel attribute](https://stackoverflow.com/q/1878657) and [Can an HTML element have the same attribute twice?](https://stackoverflow.com/q/26341507) – Siguza Dec 05 '21 at 01:08
  • 2
    Are you sure the PHP output `=$site->book_link()->html()?>` isn't directly placing this attribute to the URL? – Skully Dec 05 '21 at 01:50
  • `rel="noreferrer"` controls the `Referer` header and related stuff. `&referrerUrl=…` isn’t a broader web thing, it’s just some parameter that’s already in your link or being added by a script. – Ry- Dec 05 '21 at 02:00
  • `Book-link: https://www.sevenrooms.com/reservations/ilbaretto` this is copied direct from the sites .txt file so the link is correct. I have no idea what script would be specifically targeting this one link.. any ideas on how to debug this? – Burger Sasha Dec 05 '21 at 11:56

2 Answers2

4

This referrer that you are getting is not effected by this meta tag because the meta tag is meant for inside javascript to use document.referrer to get the referrer url in your browser or from your webserver for tracking purposes.

The referrer in your link is either because of some script or front end framework you are using or because of a backend framework or language like php.

To be able to solve your problem better we will need to know more about your frontend and backend stack.

Consequently this question is tagged wrong. It should be tagged with javascript or php.

user14665310
  • 524
  • 4
  • 13
0

It's simple "no-referrer", which specifies that no referrer information is to be sent along with requests made from a particular request client to any origin. The header will be omitted entirely.

If a document at https://techcaregn.com/page.html sets a policy of "no-referrer", then navigations to https://techcaregen.com/ (or any other URL) would send no Referer header. It is my personal opinion .