: Custom short URLs I'm creating a WordPress site for a client and he mentioned that he would like his own custom URL shortening when sharing to Twitter. How do I go about setting up one of
I'm creating a WordPress site for a client and he mentioned that he would like his own custom URL shortening when sharing to Twitter.
How do I go about setting up one of these? If I had to guess, I would guess that it's a separate domain that redirects to the actual site. If that's the case, then how do I get the URL to redirect to the specific post and not just to the homepage of the site?
More posts by @Karen161
1 Comments
Sorted by latest first Latest Oldest Best
You could try this recipe taken from the chapter on cloning TinuURL in the book Cloning Internet Applications with Ruby -
Make a hash of the long url(In this case, if it will be used to redirect to one domain, you could just make a hash of the relative url)
Convert it to base 36 - 26 alphabets and 10 digits.
Set up a 301 from short/base36(hash) to long domain.
And on the long domain, you can code a controller that sends a request to the short domain to create a short url every time a new page is created.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.