There’s a Podfeet URL for That (AKA Fun With Redirects)

There’s a lot of cool stuff associated with Podfeet Productions. We’ve got a live show, we’ve got a Facebook group, we’ve got a Google+ community, there’s ways to contact me on Twitter, the list goes on and on. I bet your head spins with all of this and if you want to participate in all of the fun, you get paralyzed trying to figure out where everything is!

I have a hot tip for you. In your web browser, type in podfeet.com and follow it by whatever service you’re interested in. Want to find the Facebook group? podfeet.com/facebook. Want to find me on twitter? podfeet.com/twitter. Looking for the direct iTunes link to the show? podfeet.com/itunes. How about our Youtube channel? podfeet.com/youtube. Finally ready to join the friendly and enthusiastic NosillaCastaways at the live show on Sunday nights at 5pm Pacific Time? podfeet.com/live.

I’ve done a TON of tutorials over on Podfeet.com, any guesses what you could type to get to them? Yup, podfeet.com/tutorials. Google Plus is going strong, if you want to join that community, you can jump right to it by going to podfeet.com/googleplus. Maybe you really wish you’d started listening to Programming by Stealth from the very beginning, how would you find just those episodes? podfeet.com/pbs.

I hope I didn’t jumble this in your head by telling you all of the options, but rather cemented into your head the idea that podfeet.com/whateveryouwant is the way to find the stuff you want!

If you want to know how it’s done, that’s even more fun. Bart and Donald worked together to help me get this set up but it’s super easy once they gave me the framework.

Inside my WordPress installation there’s a hidden file called .htaccess. this is a hypertext access file that is used by web server software and it’s designed to do exactly what I’m doing with it. In the .htaccess file I have a series of lines that start with RewriteRule. I follow that by a carrot ^, and then the name I want to follow podfeet.com. So to make the podfeet.com/live link, I start with RewriteRule ^live. Next up is a dollar sign, and then the real, long and annoying url.

Finally we close this all off with [R=301,L]. This last bit tells the web server that we we want a permanent redirect (that’s the 301 bit), and the that this is last redirect the server will see. I’m guessing that means for this particular query since each of my redirects goes

My .htaccess ReWriteRules:

RewriteRule ^twitter$ https://twitter.com/podfeet [R=301,L]
RewriteRule ^facebook$ https://www.facebook.com/groups/nosillacast [R=301,L]
RewriteRule ^googleplus$ https://plus.google.com/communities/117336672755291339814 [R=301,L]
RewriteRule ^itunes$ https://itunes.apple.com/ca/podcast/nosillacast-mac-podcast/id81677867 [R=301,L]
RewriteRule ^subscribe$ http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=81677867 [R=301,L]
RewriteRule ^youtube$ http://www.youtube.com/user/nosillacast [R=301,L]
RewriteRule ^iosapp$ https://itunes.apple.com/us/app/nosillacast/id561466798?mt=8 [R=301,L]
RewriteRule ^live$ https://www.podfeet.com/blog/nosillacast-live [R=301,L]
RewriteRule ^amazon$ https://www.podfeet.com/blog/amazon-affiliate-links-by-country/ [R=301,L]
RewriteRule ^ccatp$ https://www.podfeet.com/blog/category/ccatp/ [R=301,L]
RewriteRule ^tutorials$ https://www.podfeet.com/blog/category/tutorials/ [R=301,L]
RewriteRule ^pbs$ https://www.podfeet.com/blog/category/programming-by-stealth/ [R=301,L]

I’m sure this was a bit more geeky than some of you wanted to learn about but I think it’s really cool. It’s easy for me to create these and it’s easy for you to remember them. Facebook Group? podfeet.com/facebook. Google Plus? podfeet.com/googleplus.

If there’s a redirect you’d like, just let me know what it is and I’ll add it. I hope you’ll never have trouble finding things on podfeet.com again!

1 thought on “There’s a Podfeet URL for That (AKA Fun With Redirects)

  1. Bart Busschots - March 25, 2016

    Nicely explained, but there are just a few small things I’d like to add for completeness.

    The L is for telling Apache’s mod re-write to stop altering the URL – if you have multiple re-write rules, every matching rule would normally apply all the way down the .htaccess file, so a URL could be transformed many times between entering mod re-write and finally coming out.

    In the case of your config, it is simple enough that the L is optional because we can see that there are no rules further down the page that could match an already re-written URL. However, it’s good practice because it prevents really tricky to track down bugs. If you expect a given rule to be the last thing to happen, you may as well mark it as such so there can be no confusion.

    Just something to clarify, the spaces are separators in the Rewrite Rules, and the square brackets denote flags, so actually, what is happening is that the RewriteRule directive expects to arguments, a pattern to match, expressed as a regular expression, and, a replacement to apply when ever the pattern is matched, optionally followed by some flags.

    The pattern in the first argument is not matched against the full URL, but only against the stuff after the first /, hence ^pbs$ means match the URL who’s bit after the / starts with a p, followed by a b, and then ends with an s with nothing in between.

    The reason you want the ^ and the $ (which mean “start of line” and “end of line”), is to prevent the rule being unexpectedly triggered by being as explicit as possible in what you are saying.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top