Title: markdefacto's Replies | WordPress.org

---

# markdefacto

  [  ](https://wordpress.org/support/users/markdefacto/)

 *   [Profile](https://wordpress.org/support/users/markdefacto/)
 *   [Topics Started](https://wordpress.org/support/users/markdefacto/topics/)
 *   [Replies Created](https://wordpress.org/support/users/markdefacto/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/markdefacto/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/markdefacto/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/markdefacto/engagements/)
 *   [Favorites](https://wordpress.org/support/users/markdefacto/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [cutenews to wordpress redirecting old urls](https://wordpress.org/support/topic/cutenews-to-wordpress-redirecting-old-urls/)
 *  Thread Starter [markdefacto](https://wordpress.org/support/users/markdefacto/)
 * (@markdefacto)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/cutenews-to-wordpress-redirecting-old-urls/#post-566700)
 * 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 ^.* http://www.newsite.com/cutenewsredirect.php?article=%4 [L]
   
       # redirect the old cutenews categories
       RewriteCond %{QUERY_STRING} (.*)category=([0-9]+)(.*)
       RewriteRule ^.* http://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: http://www.newsite.com/pi-is-great");
               break;
   
               case "8675309":
                       Header("HTTP/1.1 301 Moved Permanently");
                       Header("Location: http://www.newsite.com/a-new-page/");
               break;
   
       }
       switch ($_GET["cutecats"])
       {
               case "1":
                       Header("HTTP/1.1 301 Moved Permanently");
                       Header("Location: http://www.newsite.com/category/foobar/");
               break;
       }
   
       ?>
       ```
   

Viewing 1 replies (of 1 total)