Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 749131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:23:58+00:00 2026-05-14T14:23:58+00:00

we are making a website that takes a generated incoming link and forwards the

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:23:58+00:00Added an answer on May 14, 2026 at 2:23 pm

    From the browser/end user point of view

    redirect_to "http://www.domain.com"
    redirect_to "http://www.domain.com", :status => 302
    redirect_to "http://www.domain.com", :status => 301
    

    are equivalent to

    head 301, :location => "http://www.domain.com/"
    head 302, :location => "http://www.domain.com/"
    

    There are some minor technical differences which can lead to one choice rather than the other.

    redirect_to exists as part of the routing architecture. You can pass URL options and the method automatically creates the final location, according to the app routing rules.

    redirect_to root_url, :status => 302
    redirect_to { :controller => "main", :action => "index" }, :status => 302
    

    On the opposite, head is a lower-level API for dealing with response headers. It doesn’t care about the meaning of the headers you are passing to the response. It’s useful when you specifically need to work with headers. I wouldn’t use it to setup redirects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a program that connects to a website and downloads XML from it.
I was making a website for a music band, and i was wondering the
I am thinking about making a website with some fairly intense JavaScript/canvas usage and
I have a question about tables in MySQL. I'm currently making a website where
Right now I'm making an extremely simple website- about 5 pages. Question is if
I'm creating a website for my church and I'm having problems making it display
I am currently in the process of making a new ASP.net MVC website, and
I'm making my way through the early Data Access Tutorials on Microsoft's ASP.NET website
I am making a classifieds website... I have these 6 tables: Every category has
Im making a rudimentary human test for a form on my website. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.