so this is my question -
I have a redirect in my .htaccess file, which works perfectly.
But now I need to call a js-function on the index page IF the redirect comes from /video. Is this possible? I have spend quite a long time on trying to figure this out - there is no code examples yet, so right now it is theoretical.
PS - I am using wordpress, so I've just added this to the general .htaccess -
Redirect 301 /video /
I would love to hear your inputs and various methods of achieving this.
EDIT So I will post the updated tried out methods here - so far we got this -
<?php $redirectedFrom = $_SERVER['HTTP_REFERER'];
if(isset($redirectedFrom)): ?>
<script type="text/javascript">
console.log("does the console work"+ "<?php echo $redirectedFrom ?>");
</script> <?php endif ?>
This would work magically, if the redirect comes from a click link to the index (ie. menues etc.) but when I just write /video in the URL, it seems like the HTTP_REFERER is not being set, and herby not accessing the IF. So do any of you have a fix for setting the referer, or some other solution?