Redirects in RoR: Which one to use out of redirect_to and head :moved_permanently?
- by scrr
Hello,
we are making a website that takes a generated incoming link and forwards the user who is clicking on it to another website while saving a record of the action in our DB. I guess it's basically what ad-services like AdSense do.
However, what is the best way to redirect the user?
I think html-meta-tag-redirects are out of question.
So what other options are there?
head :moved_permanently, :location => "http://www.domain.com/"
This one is a 301-redirect. The next one is a 302:
redirect_to "http://www.domain.com"
Are there any others? And which is best to use for our case? The links are highly-dynamic and change all the time.
We want to make sure we don't violate any existing standards and of course we don't want search-engines to tag us as spammers (which we are not, btw).
Thanks!