random post redirect in wordpress with a .php file

My guess would be that go.php is located in the root of the WordPress install.

The code in that fild would be something like this.

<?php require 'wp-config.php';

$post = get_posts([
    'post_type'      => 'post',
    'orderby'        => 'rand',
    'posts_per_page' => 1, 
]);

if (!empty($post)) wp_redirect(urldecode(get_permalink($post[0])));

This is a wild guess but it does the job.

This code gets one random post.
If found post, get the post permalink (url), decode the url (good if you use other languages besides english) and redirect to that post.