Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I set up wordpress to recognize

www.example.com/wp-content/uploads/2010/12/history.pdf

as something like

www.example.com/about/pdf-download/

I also want the user not to see the actual link but the new one.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Do you just need to redirect that one specific request (for /wp-content/uploads/2010/12/history.pdf to /about/history.pdf)? Or do you need to to handle many requests (say, for /wp-content/uploads/2010/12/* to /about/*)?

If it's the former, use a symbolic link (or, if you're not on Unix/Linux/BSD, whatever equivalent your OS offers). If it's the latter, use mod_rewrite (or, if you're not using Apache, whatever equivalent your Web server offers).

share|improve this answer
2  
I'd go one step further and say if it's the latter, use WordPress' Rewrite API instead of mod_rewrite - codex.wordpress.org/Rewrite_API –  TheDeadMedic Dec 9 '10 at 14:43
add comment

If you're not comfortable with the methods jalefkowit suggested (due to lack of familiarity, not because they're not a good way to accomplish this!), you might want to take a look at the Redirection plugin.

share|improve this answer
    
I set up a redirection with pass-through(masquerade one URL as another). When I access the new link there seems to be a problem with headers as the pdf file is coming out like: %PDF-1.4 %äüöß 2 0 obj << /Length 3 0 R /Filter /FlateDecode >> stream x��]�n$����Pgn'�[00��J>�݀?�`xx.��Β� �/�e0�$��ڞ�J&�X_,��~��? –  imHavoc Dec 9 '10 at 23:44
    
Not sure what you mean by "is coming out like". Do you mean when you click the link, you're redirected to a page with those characters on it? –  tnorthcutt Dec 10 '10 at 14:33
    
yes, thats exactly what i mean –  imHavoc Dec 10 '10 at 20:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.