Support » Plugins » URL Rewrite for Query in URL

  • I created two WP pages, one parent to the other. And I’m passing a variable from pageone to pagetwo. What do I need to do to rewrite the url so the querystring is extended to another folder?

    So I have

    /pageone/pagetwo/?getCat=Flowers

    How can I make it:

    /pageone/pagetwo/flowers/

    I’m using WordPress 2.3.1

    I assume I need to add a rewrite rule to my htaccess. Can someone help me with the rule?

    I remember reading something about 2.3.1 doing something to rewrites, does it affect this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • I thought it might be helpful to list my htaccess file as it is today.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Anyone able to help on the rule for me?

    On another note, I saw a comment from another forum that it’s bad to have it duplicated as it is above. IS that correct?

    mjulson, I don’t know what the actual effect of having everything duplicated in your .htaccess would be, but it sure isn’t necessary.

    If you figure this out, please let the rest of us know. I’ve been struggling with this myself for some time. Whether it is within the .htaccess rewrite rules that it needs to change or if there is something that could be done with a plugin or hack, I haven’t been able to figure out. But I sure could use the ability to attach variables to the end of permalinks.

    Thanks, I guess I’ll remove the upper section.

    Anyone have any suggestions on other resources I might use to figure out how to create the rules? I tried a couple other places and got flamed for WP’s use of mod rewrite. Is there another forum that’s friedly to WP folks?

    If no one can help figure this out, does anyone know of tutorials beyond the basic ones already listed in the docs? I’ve gone through the basic docs and read a lot of non-wordpress related docs but I can’t figure out the rules I need. I think my problem is that it’s conflicting with what WordPress is already doing.

    I’ll offer up a shaker and martini glasses to someone that helps me sucessfully get this working.(company swag) 🙂

    The problem is that WP no longer uses .htaccess and mod_rewrite for permalinks – everything is rewritten to index.php, and the code examines the URL and finds the appropriate content.

    You may need a plugin to get what you want.

    Bump.

    Using htaccess rules or not, has anyone figured out how this can be done? I’ve been beating my head into the wall for a week not trying to do the same thing. 🙁

    Ever figure this one out?

    I’d like to be able to re-write a ‘nice’ URL to pass parameters to a common wordpress page. For example, I’d like to make the URL:

    /destination/phoenix/arizona/

    re-write internally to:

    /destination?city=phoenix&state=arizona

    so that the page ‘destination’ can work with the parameters.

    Anyone?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘URL Rewrite for Query in URL’ is closed to new replies.