[wp-hackers] Help with wp_rewrite?

Robin Adrianse robin.adr at gmail.com
Sat Dec 1 01:37:30 GMT 2007


Would using array_merge() instead of using + work? Just shooting out in the
dark here, I've never seen anyone use + to merge arrays before, but it could
be done, knowing PHP ;).

On Dec 1, 2007 9:21 AM, Derek Hogue <derek at amphibian.info> wrote:

> Hey all,
>
> I know this seems to be a common thread, but reading through old posts
> here and scouring the codex and forums is not bringing me to a solution.
>
> It's pretty simple - I'm looking for a way to add a simple Rewrite tot
> he WP Rewrite rules..  Following the codex example, and other
> examples, this seems like it should work:
>
> function gigpress_feed_rewrite($wp_rewrite) {
>     $feedrules = array('^shows.xml$' => 'wp-content/plugins/gigpress/
> feed.php');
>     $wp_rewrite->rules = $feedrules + $wp_rewrite->rules;
> }
>
> add_filter('generate_rewrite_rules', 'gigpress_feed_rewrite');
>
> But no go - I just get redirected back to my index.
>
> f I manually add this to my .htaccess file, above WP's conditions:
>
> RewriteRule ^shows.xml$ wp-content/plugins/gigpress/feed.php [L]
>
> It works like a champ.  And I am indeed updating my permalinks on my
> options page.
>
> Any ideas as to what I'm missing here?  Any help would be greatly
> appreciated - thanks.
>
> Derek
> --
> http://amphibian.info
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list