Title: Plugin Rewrite Help
Last modified: August 19, 2016

---

# Plugin Rewrite Help

 *  [clwill](https://wordpress.org/support/users/clwill/)
 * (@clwill)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-rewrite-help/)
 * I’m convinced I can do this, but I’m just blanking on it. Please help my feeble
   brain 🙂
 * I am writing a plugin that needs to handle a specific rewrite scenario. I want
   to have my plugin code handle all requests that take the form: [http://example.com/xyz](http://example.com/xyz)
   and children ([http://example.com/xyz/whatever&#8230](http://example.com/xyz/whatever&#8230);).
   I’m OK with the later being turned into some query var (e.g. ?xyzpage=whatever)
   and handle that later on.
 * I cannot solve it with adding template pages because I don’t know what the theme
   is, and want the user to be able to choose their own theme. I can’t just hack.
   htaccess and pound in rewrite rules there, because it would take it out of WP
   as I want it to be part of the WP system (I need get_header and friends, as well
   as most of WP anyway).
 * I’m sure the answer is somewhere in the wp_rewrite world, is it simply adding
   a rewrite rule at the front? How do I then get my plugin in charge and skip index.
   php?
 * Thanks for your help,
    Chris

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

 *  Thread Starter [clwill](https://wordpress.org/support/users/clwill/)
 * (@clwill)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-rewrite-help/#post-1836448)
 * Still having this issue. Anyone have any ideas?
 *  [shazdeh](https://wordpress.org/support/users/shazdeh/)
 * (@shazdeh)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-rewrite-help/#post-1836449)
 * I don’t know about rewrites, but you could use template_redirect hook, check 
   for url and do your thing. It works.

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

The topic ‘Plugin Rewrite Help’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [shazdeh](https://wordpress.org/support/users/shazdeh/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-rewrite-help/#post-1836449)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
