Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Giving a PDF file a shorter (defined) URL WordPress


Hi Guys

Ok so i've uploaded a pdf file to the media library

All good

However I want to use this link to link to it

What's the best way to do this, ideally from within Wordpress?

Needs to be client friendly so plugin suggestions would be best.

Many thanks

Answers (5)


Navjot Singh answers:

Try [[LINK href=""]]Redirection[[/LINK]] Plugin.

Navjot Singh comments:

Or Use this [[LINK href=""]]Safe Redirect[[/LINK]] Plugin. It is much lighter than the Redirection one which does too many things for a simple task.


Dbranes answers:

Here is another way to do it, if you don't want to use a plugin:

function custom_redirect() {
if ( is_page('disclaimer') ) { wp_redirect(""); exit();}
add_action('wp', 'custom_redirect');

if your page slug is "disclaimer".

Steve Watson comments:

Brilliant thanks. I now know something new which is great.


Francisco Javier Carazo Gil answers:


You need to do a redirection, something like this will be useful:

Francisco Javier Carazo Gil comments:

The one told by Navjot is the best option, if not try one of this others:


Daniel Yoen answers:

try this :-)


daas answers:

Hi there,
add this code to functions.php

add_action('after_switch_theme', 'wp49547_rewrite');

function wp49547_rewrite()
add_rewrite_rule("^disclaimer/?", home_url('wp-content/uploads/2013/04/epic-disclaimer.pdf'), 'top');

and then go to settings->permalinks, click save to flush rewrite rules.