Redirect Web Site Folder (WordPress)

2012-04-11 Initial Post

When I first set up this blog, the WordPress Permalink Settings was set to use Day and name (e.g., http://sysadmin-e.com/2012/04/11/sample-post/). Later on, I changed it to Custom Structure (e.g., /%postname%) without thinking about how to redirect from the old format to the new format.

I had posted a comment on http://jack.ukleja.com/using-a-telnet-client-as-a-port-scanner/ and put a link to my post at http://sysadmin-e.com/2010/02/04/telnet/. So after changing the permalink settings, the link to my post no longer worked. So how do I redirect it? That link isn’t to an HTML file, but to a directory/folder, so I wasn’t sure how to do this.

I finally got around to messing with this last night and it took me a while to find a solution because my searches kept pointing to examples of using .htaccess and RewriteRule, which isn’t what I wanted. After more searching, I found the solution here: http://www.besthostratings.com/articles/htaccess-redirects.html.

This is what I ended up doing (I don’t know if there’s a simpler way, but this worked for me, so that’s all I need):

  •  Go into BlueHost cPanel --> File Manager.
  • Under public_html, create this folder structure: 2010/02/04/telnet.
  • Under telnet, create a file named .htaccess.
  • Edit the .htaccess file and put in this one line: Redirect /2010/02/04/telnet /telnet

Leave a Reply