I have seen many snippets to display random post/posts on a page. Most of them provide a function or wp_query code to be directly placed where it is required. In the end they tell to create a template random.php and page with name RANDOM. So, when one wants to access that page, they can look for a link pointing as http://domain.com/random/. And every time, I find the same URL -->http://domain.com/random/. What I want is to display the URL of the post i.e permalink in the address bar, whenever one clicks on random page link e.g post-permalink. I use this piece of code.
query_posts(array(
'showposts' => 1,
'orderby' => 'rand',
));
if (have_posts()) : while (have_posts()) : the_post();
I don't know much about using 'base' and 'format' arguments in the array, they might serve purpose.
Thanks