Title: conservation's Replies | WordPress.org

---

# conservation

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

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

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [WPML causes error: query.php on line 2890](https://wordpress.org/support/topic/wpml-causes-error-queryphp-on-line-2890/)
 *  [conservation](https://wordpress.org/support/users/conservation/)
 * (@conservation)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/wpml-causes-error-queryphp-on-line-2890/#post-1933597)
 * hi all.
    I also have the same proplem. When my page in english language, get_term_link
   work fine. Link is: [http://homepage/category/drill](http://homepage/category/drill).
   But when page in vietnamese language, get_term_link work wrong, link is : [http://homepage/vi/vi/category-vi/drill-vi](http://homepage/vi/vi/category-vi/drill-vi).
   I don’t know why :((. help me
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom Rewrite Rules stopped working with 3.1](https://wordpress.org/support/topic/custom-rewrite-rules-stopped-working-with-31/)
 *  [conservation](https://wordpress.org/support/users/conservation/)
 * (@conservation)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-rewrite-rules-stopped-working-with-31/#post-1939259)
 * Hi uilhao. I added function.php file the following code:
 *     ```
       add_filter('wp_loaded','flushRules');
   
           // Remember to flush_rules() when adding rules
           function flushRules(){
                   global $wp_rewrite;
                   $wp_rewrite->flush_rules();
           }
       ```
   
 * But… It hasn’t worked yet.
    I don’t know why :((. Do you have other solutions?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [All Permalinks Broken After Upgrade to 3.1 from 3.0.5](https://wordpress.org/support/topic/all-permalinks-broken-after-upgrade-to-31-from-305/)
 *  [conservation](https://wordpress.org/support/users/conservation/)
 * (@conservation)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/all-permalinks-broken-after-upgrade-to-31-from-305/#post-1944557)
 * Hi kkirsche. what did you do to fix it. May you share your solution for me? I
   haven’t fixed it yet. :((
    This is my code :
 *     ```
       remove_filter('template_redirect', 'redirect_canonical');
           /*Custom url rewrite */
           function mechanical_rules( $rewrite_rules ) {
               $new_rules = array(
                   '^category/([^/]*)/brand/([^/]*)/.html$' => 'index.php?pagename=products&cate=$matches[1]&br=$matches[2]'
                  ,'^brand/([^/]*)/category/([^/]*)/.html$' => 'index.php?pagename=products&br=$matches[1]&cate=$matches[2]'
   
                   );
               $rewrite_rules = $new_rules + $rewrite_rules;
               return $rewrite_rules;
           }
           add_filter('rewrite_rules_array', 'mechanical_rules');
   
           add_filter('query_vars', 'mechanical_query_vars');
           function mechanical_query_vars($public_query_vars) {
               $public_query_vars[] = 'cate';
               $public_query_vars[] = 'br';
               return $public_query_vars;
           }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom Rewrite Rules stopped working with 3.1](https://wordpress.org/support/topic/custom-rewrite-rules-stopped-working-with-31/)
 *  [conservation](https://wordpress.org/support/users/conservation/)
 * (@conservation)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-rewrite-rules-stopped-working-with-31/#post-1939257)
 * :(( help me, i haven’t do it yet. uilhao, help me. I added your code line in 
   function.php file, but it don’t work. this is my code:
 *     ```
       remove_filter('template_redirect', 'redirect_canonical');
           /*Custom url rewrite */
           function mechanical_rules( $rewrite_rules ) {
               $new_rules = array(
                   '^category/([^/]*)/brand/([^/]*)/.html$' => 'index.php?pagename=products&cate=$matches[1]&br=$matches[2]'
                  ,'^brand/([^/]*)/category/([^/]*)/.html$' => 'index.php?pagename=products&br=$matches[1]&cate=$matches[2]'
   
                   );
               $rewrite_rules = $new_rules + $rewrite_rules;
               return $rewrite_rules;
           }
           add_filter('rewrite_rules_array', 'mechanical_rules');
   
           add_filter('query_vars', 'mechanical_query_vars');
           function mechanical_query_vars($public_query_vars) {
               $public_query_vars[] = 'cate';
               $public_query_vars[] = 'br';
               return $public_query_vars;
           }
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)