Google’s Webmaster blog wrote some solution on how to prevent Open Redirect Protection abuse, I’ve been perplexed by some of the solutions there for quite sometime, I tried googling but found no results.
- Change the redirect code to check the referer
- Consider using a whitelist
- Consider signing your redirects
- Specifically disallow off-site redirects
My guesses on the solution:
- Use
%{HTTP_REFERER}to do some checking in the url request - Use some regex in the url request to check if the site in the url
request is within the scope of the regex - Can’t think of any
- Can’t think of any
Please let me know if my guesses are correct, and if they’re not please tell me how to do it correctly in PHP or Apache. Thanks!
1 Answer