Redirect to Dynamic URL
Last updated on
30 April 2025
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
By setting the $node->webform['confirmation'] key, you can change where Webform redirects the user after form processing has been completed. Use the code below to change the URL based on your own criteria.
// Redirect to Google when done.
$node->webform['confirmation'] = 'http://google.com';
// Redirect to node 1 (an internal Drupal path).
$node->webform['confirmation'] = 'internal:node/1';
// Redirect to the contents of a hidden field.
$node->webform['confirmation'] = $form_values['submitted_tree']['my_hidden_value'];
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion