Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

How to redirect a referal url to a signup page?

At the top of your index page.

You could add.

if( isset( $_GET['ref'] ) && $_GET['ref'] !== '' )
    wp_safe_redirect( '/signup' )

Then, on the sign up page add:

$the_referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';

So you can do whatever you want with that, I would add some escaping etc and you’ll prob have to str_replace() to get the ID solely.

Thanks.

Related Posts:

  1. Redirect user to a form until they have filled it out [closed]
  2. Redirect user to previous page after signup from custom form
  3. PHP header(Location: …): Force URL change in address bar
  4. What does HTTP/1.1 302 mean exactly?
  5. php refresh current page?
  6. How to force a 404 on WordPress
  7. Disable front end to use as CMS only?
  8. Redirect Restricted Page to 404
  9. How to redirect non-logged in users to a specific page?
  10. How to prevent automatic redirection of 404 errors and “incorrect” URLs?
  11. How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
  12. Disable WordPress URL auto complete
  13. Host the wp-admin on another domain?
  14. Redirect user to original url after login?
  15. When I change slug, will WordPress create redirect from the old URL?
  16. WordPress localhost site redirect to live site
  17. WordPress redirecting connections on port 8080 to 80
  18. WordPress Redirect All HTTP requests to HTTPS via .htaccess
  19. wp_redirect() function is not working
  20. Redirect entire website to a single page
  21. My wordpress multisite homepage redirects to signup page
  22. Logout redirect to home page
  23. Disable ONLY URL auto complete, not the whole canonical URL system
  24. Redirect Localhost wordpress site to dashboard
  25. Redirect page URL to home URL without using a plugin
  26. Why is WordPress redirecting from http to https on a local environment?
  27. Login redirect to previous page
  28. How to prevent redirect to ‘About’ after core upgrade?
  29. 301 redirect instead of 404 when URL is a prefix of a post or page name?
  30. Why is wp_redirect() preferable to a standard PHP header redirect?
  31. How do I programmatically generate a 404?
  32. Redirect to referring page after logging in
  33. User redirect to destination URL after login
  34. Prevent access to single post types
  35. check first time login only
  36. How to change the default logout link on WordPress Admin
  37. Stop WordPress from “guessing” redirects for nonexistent URLs
  38. WordPress install enters an infinite loop
  39. How to redirect a sucessful registration to a page template?
  40. How to configure nginx to redirect requests to the uploads directory to the production server?
  41. WordPress HTTPS redirect loop
  42. Why am I getting a 301 on a existing post?
  43. Redirect to dashboard after login
  44. Make a video post redirect to next post after completion
  45. Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
  46. Non-WordPress page in subdirectory under WordPress page
  47. Force HTTPS using .htaccess – stuck in redirect loop
  48. How to redirect after login, the working way?
  49. Keeps on redirecting on my development copy
  50. Password change when the user login first time
  51. Custom login form redirect to external site
  52. Redirecting WordPress /.htaccess / HSTS / SSL
  53. 301 redirect not working through .htaccess
  54. handling login/logout redirects
  55. Clarification on auth_redirect()
  56. Site redirects to wrong url when saving settings
  57. How to redirect all requests to wp-login.php?
  58. Implementing global redirection (automatic redirect for all pages who had their slug changed)
  59. Correct way to hide pseudo pages from being shown?
  60. Redirect blog page to latest post?
  61. Redirect to custom url when registration fails?
  62. Why does WordPress automatically redirect URLs with the parameter “name=” to a different page?
  63. prevent/block direct access to a thank you page
  64. Redirect After Delete User in Backend
  65. Exclude a path from WordPress using .htaccess redirects (Apache)
  66. Restrict Access to wp-login.php
  67. How to setup 301 redirects for multiple query string URLs?
  68. How to redirect url requests to https? [closed]
  69. Using `auth_redirect` : keeps asking me to login even when I’m logged in
  70. Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
  71. Redirect to post after submission with Gravity Forms? [closed]
  72. How can I move/redirect single blog posts from one blog to another?
  73. Best way to handle redirects
  74. WordPress site redirects to different wordpress domain on the same server after reuploading db backup
  75. Redirecting old permalink to new one
  76. WP auto redirects after url change?
  77. Setting a redirect cookie in wordpress
  78. Index in root, wordpress in subdirectory
  79. Redirect www to non-www htaccess
  80. 302 redirect instead of 301 after switch to HTTPS
  81. Stop WordPress Redirection From /keyword to /some-post-containing-keyword/
  82. Specific URL has 403 Forbidden status code
  83. How do I skip wordpress’s 404 handling?
  84. How to create a php url redirection for nicer links
  85. WordPress overriding actual subdirectories
  86. Redirect to custom URL after registering from a page with registration form
  87. Redirect users after first login
  88. Stop unwanted WP redirection to new url
  89. WordPress Redirect based on the prescence of a cookie
  90. Using redirection plugin to pass URLs as lowercase to wordpress
  91. Facebook like button that redirects?
  92. Prevent redirect to page/page when reserved term ‘name’ in $_POST when value is a page/post title
  93. Custom domain for sub-section of parent website
  94. Problem to redirect custom page using htaccess
  95. Redirecting to home-page when saving any edited code
  96. Redirect to current page after wordpress login
  97. How does WordPress redirect to WooCommerce shop page? [closed]
  98. WordPress within a subdirectory of another WordPress environment doesn’t work
  99. WP redirects all pages from new domain to old domain
  100. wp-login.php — redirect logged in users to custom URL
Categories redirect Tags redirect, signup
calling pages instead of posts
Custom Sign Up Form for a Custom WordPress Website

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress