WordPress.org

Support

Support » Plugins and Hacks » Hacks » Need some help with add_rewrite_rule !

Need some help with add_rewrite_rule !

  • Hi everybody,

    i’m searching long time the solution of this problem. i’m creating somme directories of society in internet, and i’m using wordpress. Here’s my problem :

    in function.php file of my theme (created before with artisteer), i’ve add this code

    global $wp_rewrite;
    add_rewrite_rule('^annuaire/([^&]+)/?','index.php?p=5&ralias=$matches[1]','top');
    add_rewrite_tag('%ralias%','ralias=');
    $wp_rewrite->flush_rules();

    And it doesn’t work.

    Finally, i have :

    http://mysite.com/annuaire/?ralias=society-name

    It’s working and i can use “ralias” in my code …

    And i want create one rule to rewrite like that

    http://mysite.com/annuaire/society-name/

    http://mysite.com/annuaire is a page … with PHP code inside.

    Please, help me and tell me what is wrong in my code.

    Cheers from Switzerland !

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need some help with add_rewrite_rule !’ is closed to new replies.