I would like to detect the referrer domain to my Rails site, and if the referrer matches a domain I would like them to be redirected to a specific page.
How could I do this?
class MyController < ApplicationController
def my_action
if request.referer =~ /a_domain_pattern/
redirect_to a_specific_page_path
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With