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.

I use custom fields named 'url' to add another website url (like http://www.youtube.com), I want to rewrite the 'url' as http://www.mysite.com/go/123.

I tried all rewrite plugins, no one could do this.

Can I set post id as 123? Or can I set a random number as it?

share|improve this question
1  
Are you trying to proxy Youtube via a URL on your site? –  Brian Fegter Oct 16 '12 at 16:56
    
Do you mean redirect to external site? Rewrite is usually for manipulating URLs to resources on your site. –  Rarst Oct 16 '12 at 18:12
    
I add more info. –  user22541 Oct 17 '12 at 3:59
add comment

2 Answers

Take a look at this tutorial (Build a Short URL Service with WordPress Custom Post Types) that show how to create this kind of redirection

or you can use a plugin that does that for you GoTo Redirect

share|improve this answer
    
Thanks for your reply, I didn't say clearly, just add more info. –  user22541 Oct 17 '12 at 3:58
add comment

Thanks for your reply, I want to auto rewrite link when I add it in custom fields named "url".

For example:

I named a "url" in custom fields add www.yahoo.com as value, I use <?php echo get_post_meta($post->ID, 'url', true); ?> to get it, I don't want to show the link www.yahoo.com, I want to rewrite it as www.mysite.com/29382 with random number automatically generated.

share|improve this answer
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.