Title: Problem with rewrite_rules_array
Last modified: August 19, 2016

---

# Problem with rewrite_rules_array

 *  [gabyrsh](https://wordpress.org/support/users/gabyrsh/)
 * (@gabyrsh)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/problem-with-rewrite_rules_array/)
 * Hi Guys,
    I want to use add_filter function as rewrite rule (.htaccess). So, 
   I have the following Code:
 * >  add_filter(‘rewrite_rules_array’,’addCustomPage’);
   > function addBuscador($rules){
   >  $newrules = array();
   > $newrules[“mynewpage/([^/]+)?$”] = ‘index.php?p=13 keyword=$matches[1]’;
   >  $
   > rules = $newrules + $rules; return $rules; }
 * But when I go to my url [http://MySite.com/mynewpage/somthing](http://MySite.com/mynewpage/somthing)
   WordPress is redirecting to index.php?p=13 (Appears the address [http://MySite.com/index.php?p=13](http://MySite.com/index.php?p=13)
   in my browser) and is not working as htaccess rewrite rule.
 * Could you help me? is possible that the function add_filter works as .htacess
   rewrite rule?
 * Thanks,

The topic ‘Problem with rewrite_rules_array’ is closed to new replies.

## Tags

 * [add_filter](https://wordpress.org/support/topic-tag/add_filter/)
 * [rewrite_rules_array](https://wordpress.org/support/topic-tag/rewrite_rules_array/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [gabyrsh](https://wordpress.org/support/users/gabyrsh/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/problem-with-rewrite_rules_array/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
