• I have a cutenews blog I am trying to convert to wordpress but for the life of me can’t get the old cutenews urls to redirect to the new wordpress ones. There are only 34 pages so I am doing this manually. I want to forward a cutenews url like https://www.someplace.com/?subaction=showfull&id=3141592653&archive=&start_from=&ucat=1& to the new, wordpress one at https://www.someplace.com/a-new-url/ so the code I tried was

    [code]
    RewriteRule ^(.*)3141592653(.*)$ https://www.someplace.com/a-new-url/ [R=301,L]
    [/code]

    This does not work, it will not forward the url. If I take the question mark out of the original cutenews url it forwards fine. I tried escaping the question mark in the rule, and I tried putting it in like a normal character but it will not work. Is there something special about a question mark so that it won’t forward?

    Now if I can’t get any of this to work, I might have to change the page and post ids of wordpress to match the ids of cutenews. Is there any reason I can’t do this or anything I should look out for? How should I do the Rewrite rule if I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter markdefacto

    (@markdefacto)

    No one ever responded but here is the solution I came up with. I found what things are unique to cutenews and won’t appear in a wordpress url and wrote something in .htaccess. It captures the unique article id or the unique category id from cutenews and passes them to a php script I made called cutenewsredirect.php. cutenewsredirect.php in turn redirects them to the correct website giving the 301 (moved permanently) status.

    .htaccess:

    # redirect the old cutenews articles
    RewriteCond %{QUERY_STRING} (.*)(subaction|start_from)(.*)id=([0-9]+)(.*)
    RewriteRule ^.* https://www.newsite.com/cutenewsredirect.php?article=%4 [L]
    
    # redirect the old cutenews categories
    RewriteCond %{QUERY_STRING} (.*)category=([0-9]+)(.*)
    RewriteRule ^.* https://www.newsite.com/cutenewsredirect.php?cutecats=%2 [L]

    cutenewsredirect.php:

    <?php
    switch ($_GET["article"])
    {
            case "3141592":
                    Header("HTTP/1.1 301 Moved Permanently");
                    Header("Location: https://www.newsite.com/pi-is-great");
            break;
    
            case "8675309":
                    Header("HTTP/1.1 301 Moved Permanently");
                    Header("Location: https://www.newsite.com/a-new-page/");
            break;
    
    }
    switch ($_GET["cutecats"])
    {
            case "1":
                    Header("HTTP/1.1 301 Moved Permanently");
                    Header("Location: https://www.newsite.com/category/foobar/");
            break;
    }
    
    ?>

    HI – Is there a guide to converting Cutenews to wordpress? I can’t find anything as of right now, seems the cutenews developer site is not functioning.

    Thanks!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘cutenews to wordpress redirecting old urls’ is closed to new replies.