Search entire site for URL and replace with a different URL?
-
Hi there,
Is there something that I can place in my functions.php file that will search my ENTIRE site for all occurrences of a URL, and then replace it with an alternative URL (i.e. the original URL but with a redirect_to extension like below).
In simpler terms…
1) Search for all occurrences of
https://www.mysite.com/login
2) Replace with
https://www.mysite.com/login?redirect_to=<?php echo "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
Is that possible? I basically don’t want to manually code this into my template files and the above solution would be perfect.
Thanks in advance!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Search entire site for URL and replace with a different URL?’ is closed to new replies.