Redirect After User Registration if Referred from Specific URL I have been trying to redirect users after filling out the user registration if referred from a specific page on the site with form_alter like so

function custom_markup_form_alter(&amp;$form, &amp;$form_state, $form_id) {

if($form_id == 'user_register_form' &amp;&amp; strpos($_SERVER['HTTP_REFERER'], 
'/resources/price-sheets') &gt; 0 ) {

    $form_state['redirect'] = 'node/50';

    }
}


If I dpm($form_state) on the user/registration page it shows the $form_state['redirect'] = 'node/50'; as it should. But when I submit the form it redirects me to the home page. I also tried replacing $form_state['redirect'] = 'node/50'; with $_GET['destination'] = 'node/50'; with the same results. I've found a few similar questions, but none of those answers are working for me either, does anyone have a good working solution?
I think you need to set the redirect in a submit handler. Add your custom submit handler to $form and then in your custom submit handler set $form_state['redirect'] to where you want it to go. Doing it in a form_alter could be why it's not working. See Redirecting a Form

function my_redirect_form_my_content_type_node_form_alter(&amp;$form, &amp;$form_state){
  $form['#submit'][] = 'my_redirect_node_form_submit';
}

function my_redirect_node_form_submit($form, &amp;$form_state) {
  $form_state['redirect'] = 'node/10'; // the address of your thank you page
  // if you are really, really determined to force the redirect, even if a destination has been set in the url, add this:  unset($_GET['destination']);
  // you could also add a message (this is in addition to whatever message is produced by the nodeapi function): drupal_set_message(t('Congratulations!'));
}