{"id":260,"date":"2008-10-24T23:24:33","date_gmt":"2008-10-25T06:24:33","guid":{"rendered":"http:\/\/blog.technicalley.com\/?p=260"},"modified":"2008-10-24T23:24:33","modified_gmt":"2008-10-25T06:24:33","slug":"sticky-permalink-issue-solved-using-htaccess","status":"publish","type":"post","link":"https:\/\/technicalley.com\/central\/blog\/2008\/10\/24\/sticky-permalink-issue-solved-using-htaccess\/","title":{"rendered":"Sticky Permalink Issue Solved Using .htaccess"},"content":{"rendered":"<p>When I had my blog <a href=\"http:\/\/blog.technicalley.com\/setting-up-my-wordpress-blog\/\">setup with Yahoo Small Business Hosting<\/a>, I had to make one compromise due to Yahoo&#8217;s restriction on the use of .htaccess file. When I set up &#8220;Permalinks&#8221; on WordPress, the best I could get was something like &#8220;http:\/\/example.com\/index.php\/my-blog-post&#8221;. I had to live with the &#8220;index.php&#8221; in all my Permalinks.<\/p>\n<p>Now that I relocated my blog to another hosting service, I had to decide how to deal with this. I imported all my old\u00a0 blog content to my new setup, and I also know that many sites have linked to many of my earlier articles. If I did not configure my new blog to also have &#8220;index.php&#8221; in the links, then all references to my older articles would fail. But now that I had a chance to really clean up the Permalinks, did I really want to continue to have &#8220;index.php&#8221; in them?<\/p>\n<p>What I really needed was a way to support &#8220;index.php&#8221; to support all my legacy posts, and yet, not have &#8220;index.php&#8221; for all new content. Now that my new hosting service allows the use of .htaccess files, I was looking for some way to achieve this &#8212; and I found a way to do it!<\/p>\n<p>In my WordPress Permalink setup, I chose the custom option to say &#8220;\/%postname%\/&#8221;. Then I added a line such as this to my .htaccess file in my WordPress installation directory:<\/p>\n<p>Redirect \/index.php\/ http:\/\/blog.example.com\/<\/p>\n<p>That was it! Now if I insert a &#8220;index.php&#8221; in any of my content URLs, it gets ignored and all my new URLs look clean. So an older post can be accessed with or without the &#8220;index.php&#8221; in the path!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I had my blog setup with Yahoo Small Business Hosting, I had to make one compromise due to Yahoo&#8217;s restriction on the use of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,46],"tags":[58,258,362],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-digital-publishing","category-web","tag-htaccess","tag-permalink","tag-wordpress","wpcat-9-id","wpcat-46-id"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":0,"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"wp:attachment":[{"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technicalley.com\/central\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}