WordPress.org

Ready to get started?Download WordPress

Forums

altering mod rewrite with 2.x (3 posts)

  1. sevennine
    Member
    Posted 8 years ago #

    ok, this is frustrating me... I'm trying to upgrade the F Gallery plugin for WordPress 2.x but the guys at WP changed the way that the Mod Rewrite works, so it's broken the plugin. I've tried looking at the wp_rewrite API and it's just baffling me even more. Does anyone know how to get it to add lines to the write rules? did they alter the way the .htaccess is working? When I look at the .htaccess file there's little in it. Is all of WP rewriting rules done under the hood and not in the .htaccess file? What's going on? WP isn't picking up any of the hooks/filters I try.

    So what I am trying to say, what hooks/filters/methods do I need to run to:
    1) add something to the rewrite rules
    2) tell WP to generate the rewrite rules

    I tried looking at the examples at the bottom of the API and they don't seem to work for me?!

    Some help would be greatly appreciated!!!!

  2. sevennine
    Member
    Posted 8 years ago #

    ok, I managed to add my rules to the rewrite, but can someone tell me why they don't work. When I print out the $wp_rewrite->rules, my section is below.

    I'm assuming that I can't use the $_GET to get the variables... what do i use?

    [photos/albums/?$] => index.php?pagename=photos&view=albums
    [photos/albums/([0-9]+)/?$] => index.php?pagename=photos&album=$matches[1]
    [photos/albums/([0-9]+)/([0-9]+)/?$] => index.php?pagename=photos&photo=$matches[2]&album=$matches[1]
    [photos/albums/([0-9]+)/page([0-9]+)/?$] => index.php?pagename=photos&album=$matches[1]&thumb_page=$matches[2]
    [photos/tags/?$] => index.php?pagename=photos&view=tags
    [photos/tags/([_0-9a-z-]+)/?$] => index.php?pagename=photos&tags=$matches[1]
    [photos/tags/([_0-9a-z-]+)/([0-9]+)/?$] => index.php?pagename=photos&photo=$matches[2]&tags=$matches[1]
    [photos/tags/([_0-9a-z-]+)/page([0-9]+)/?$] => index.php?pagename=photos&tags=$matches[1]&thumb_page=$matches[2]
    [photos/page([0-9]+)/?$] => index.php?pagename=photos&thumb_page=$matches[1]
    [photos/([_0-9a-z-]+)/?$] => index.php?pagename=photos&view=$matches[1]
    [photos/([_0-9a-z-]+)/page([0-9]+)/?$] => index.php?pagename=photos&view=$matches[1]&thumb_page=$matches[2]
    [photos/([_0-9a-z-]+)/([0-9]+)/?$] => index.php?pagename=photos&view=$matches[1]&photo=$matches[2]

  3. sevennine
    Member
    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags