What would be the easiest route for creating permanent redirects to youtube based on user form input?
-
21-12-2019 - |
Question
Say I have a site, we'll say fakesitename.com. I want users to be able to fill out a form with five inputs:
- A Youtube video ID
- A start time
- An end time
- An alias
- A submit button
I'd like them to be able to submit this form, and for the site to create a redirect (preferably a 301 redirect, so I'm never technically hosting any content) from:
- fakesitename.com/[[input4]]
to
- Something like https://www.youtube.com/v/[[input1]]?hd=1&autoplay=1&start=[[input2]]&end=[[input3]]&version=3
What would be the best / easiest way to go about this? I'm not worried about handling the url layout generation, just writing the redirect.
Thanks for the help!
Solution
Well just use header to send a location
header
header('Location: http://www.youtube.com/?blabla', true, 301);
exit;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow