Apache 301 redirects on GoDaddy web hosting

I have a shared web hosting account on GoDaddy, and wanted to do a 301 redirect with an Apache .htaccess file. For some unknown reason GoDaddy’s web interface wasn’t working for this, so I thought I’d fix the problem manually.

In short, this did NOT work:

Redirect 301 /the-old-uri  http://alvinalexander.com/the-new-uri

The problem with GoDaddy shared web hosting is that you have to include the subdirectory your website is installed under, and in short, this solution DOES work:

Redirect 301 /the-subdirectory/the-old-uri  http://alvinalexander.com/the-new-uri

Once I put the subdirectory my website is installed under (i.e., the subdirectory I created under the html directory that GoDaddy created), the Apache 301 redirect worked as desired.

I know that’s a short explanation of the problem and solution, but I hope it’s helpful.