Title: Using WP_Rewrite Function
Last modified: August 20, 2016

---

# Using WP_Rewrite Function

 *  [macleodjb](https://wordpress.org/support/users/macleodjb/)
 * (@macleodjb)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/using-wp_rewrite-function/)
 * Hi Guys,
 * I’m not good with using mod_rewrite but I’m sure this will be simple for you 
   guys.
 * I am trying to rewrite a url like this.
 * [http://mysite.com/test/apple](http://mysite.com/test/apple)
 * to
 * [http://mysite.com/test/?id=apple](http://mysite.com/test/?id=apple)
 * What is the easiest way to achieve this result. This is for my custom plugin 
   so I can’t directly modify the htaccess file.
 * Thanks in advance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [macleodjb](https://wordpress.org/support/users/macleodjb/)
 * (@macleodjb)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/using-wp_rewrite-function/#post-2470127)
 * I’ve come up with this but it doesn’t work. Any help
 * $newrules[‘^test$/([A-Za-z0-9-^_]+)’] = ‘^test/?id=$1’;

Viewing 1 replies (of 1 total)

The topic ‘Using WP_Rewrite Function’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [macleodjb](https://wordpress.org/support/users/macleodjb/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/using-wp_rewrite-function/#post-2470127)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
