. . . . how are you all doing
I have a wordpress blog with 29 posts. The URL structure was
http://www.domain.com/category/cat_name/post_name/
which I have changed to
http://www.domain.com/post_name/
using the permalink settings. I also wanted my older links to work so I did redirects using htaccess
Redirect 301 /categories/cat_name/post_name/ /post_name/
I have checked all links and they are working.
Now what I need to know that is this a good approach or is their a better approach to do it. Doing redirects for 29 links?
Try with de function get_page_by_path($args) of core of wordpress.
See the docs in http://codex.wordpress.org/Function_Reference/get_page_by_path
Get lucky.