0

I am trying to redirect to a page from the server without referrer. Right now I am doing redirect like this:
enter image description here

I haven't found any overloads for Redirect method or any other ways to redirect without referrer so it's present on the page:
enter image description here

So is there any solution to redirect without referrer in ASP.NET?

Storm
  • 557
  • 1
  • 8
  • 25
  • What does in mean **redirect without referrer** if in the first sentence you are already talking about **a page**? – Jackdaw Dec 22 '20 at 13:22

2 Answers2

1

You can't handle the referrer from the Redirect method, but you can do one of the following:

  1. Launch the new page on a new window.

  2. Using a meta tag on the content page as follows:

    <meta name="referrer" content="no-referrer" /> Or you can add the tag following this answer: How to add meta tag to ASP.Net content page

  3. Move the redirect logic to the front and use rel(attribute specifies the relationship between the current document and the linked document) use:

    <a href="exampleurl.com" rel="noreferrer">link</a>

Julissa DC
  • 251
  • 3
  • 14
0

I think you're asking "after my C# server code sends a redirect to the client browser, telling it to go somewhere else, I want the browser to NOT put my site URL into the Referer header when it goes to that somewhere else"

You can't, if it's direct, unless you're redirecting from a secure page (yours) to an insecure page (theirs)

You'll probably have to create an interim page that you redirect to, that has some client side scripting that performs the actual transition (like those "thanks for searching your flight with expedia, please wait while we transfer you to the airline to complete your booking" type pages) because then you can take control of what their browser sends; if you straight refer them, you can't

Caius Jard
  • 72,509
  • 5
  • 49
  • 80