[wp-hackers] 2 Questions: $_REQUEST equivalent and using GET in mod_rewrite

Alex Andrews awgandrews at gmail.com
Tue Aug 28 17:01:28 GMT 2007


> > More importantly, I want to use mod_rewrite to map onto this plugin. I
> > know Wordpress can do this, but I am not sure how. Here is the schema
> > I imagine, artists.php being replaced by the correct wordpress plugin
> > hookup (some suggestion here might be helpful two)
>
> One of my plugins uses the following:
>
> function myRewrite($rules)
>         { $rules['foo'] = 'index.php?pagename=foo'; return $rules; }
>
> add_filter('rewrite_rules_array', 'myRewrite');
>
> When the plugin is activated, you must visit
> wp-admin/options-permalinks.php (once is sufficient) to add your slug to
> WP's ruleset.
>
> Then, every request that calls /foo/* in this example, will be handled
> by the plugin. However, this solution also requires to have a page with
> the slug "foo". Maybe there's a better solution, but this one works for
> me.

It appears that in the Codex there is a description. It seems the
latter example might suit my needs if adapted, but the problem is
still input. How can I get /artists/x/ to translate to
artists.php?id=x or whatever.

http://codex.wordpress.org/Function_Reference/WP_Rewrite#Example

Regards

Alex


More information about the wp-hackers mailing list