3rd party is 302 redirect to my website, how to stop?

僤鯓⒐⒋嵵緔 提交于 2019-12-10 23:16:39

问题


EDIT:

Maybe a better tl;dr version of my question (my brain is a little mashed)...

Either (ideally): Can I detect a referral URL with an off-domain 302 redirect? Or: Can I detect that a 302 redirect was used to access my website?

EDIT 2 (from suggestion):

Request.UrlReferrer doesn't work in this situation, it returns as simply "https://www.google.co.uk/". I was expecting perhaps the referring URL of www.google.co.uk?url=maliciouswebsite.com - but sadly not.


A malicious website appears in Google. The link in Google points to www.maliciouswebsite.com - however when you click the link, you get sent to www.mywebsite.com.

So people google "MaliciousWebsite" and find their way to MyWebsite. I did a DNS check on maliciouswebsite.com and it has been 302 Redirected to mywebsite.com.

What I'm trying to do is "If the request is a 302 redirect sent from MaliciousWebsite.com - do not show my website".

I need a way of identifying that the request originated from MaliciousWebsite in some way.

Hope that makes sense!?


回答1:


I assume you are using ASP.NET since you tagged the question as C#.

Well, ASP.NET offers a property that give you the address of the page where the request to your page originated from.

Try to use

Request.UrlReferrer 

http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer(v=vs.110).aspx



来源:https://stackoverflow.com/questions/25057172/3rd-party-is-302-redirect-to-my-website-how-to-stop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!