• My client had a subdomain hosted by kickapps for social networking. The company dropped him. We got the database of discussions from kickapps and inserted the discussions in wp_posts.

    We soon discovered that some of the links refer to kickapps. Here is one sample:

    https://community.gottrouble.com/kickapps/service/displayDiscussionThreads.kickAction?as=27774&w=117343&d=27764

    Fortunately, I created the post_name from the discussion id, which in this case, is ‘post-27764’.

    When someone clicks on the link, you get the 404 page. Obviously.

    There is enough information in the query string to extract the discussion id and compose the post_name.

    The new URL becomes https://community.gottrouble.com/post-27764.

    My current code uses this query to see if the post is published:

    $post = 'post-' . $threadid;
    $page = 'https://community.gottrouble.com/' . $post;
    $r = $wpdb->get_results("SELECT post_status FROM $wpdb->posts WHERE post_name='" . $post . "'", ARRAY_A);

    What is the best way to redirect to the new URL? Neither http_redirect nor header() work. (Yes, I removed all comments).

    Thanks in advance.

    In the 404 page

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Migrating from kickapps to WP’ is closed to new replies.