Support » Themes and Templates » pretty urls and extra parameters

  • hi,
    I am wondering if there is any easy way to pass parameters to a template while still maintaining pretty urls and not running into a page not found error.

    As an example:
    if i have a userlist and want to create a page that filters by some criterias i can easily create a query based on the get parameters as long as i provide them in the usual form as ?parameter1=value1&parameter2=value2

    but as soon as i try to work with url rewriting and create sth like

    i will run into a 404 error as the page is not existing. So therefore it would be needed to handle this extra parameters internally with wordpress.

    is there any way to do this with native wordpress features? if so, how? can anyone point me into some direction.


Viewing 6 replies - 1 through 6 (of 6 total)
  • chyeaaa! I’d love to know how to do this too!

    I need this as well, and actually I don’t care too much about url rewrites for this particular page. &1=value1&p2=value2 is fine with me, but I can’t get that to work either?

    I have a search page and a results page that queries the database based on the input on the 1st search page

    I use custom template pages passing the parameters using $_get but keep getting an error (404) on

    How, if at all can I do that?

    @vision22, did you manage to get it to work without the url rewrites?

    A plugin can do it. You might start here:

    Thanks Otto, a good start and interesting stuff! although not a typical WP plugin but more a tutorial I think.

    I RTFM (also from sitepoint) 😉 and still haven’t got a clue where to add what. I am aware of the .htaccess functionality, but I am not an expert. I do code php.

    Basically all I want is to include a page in my theme (or in the root) within WP that has parameters. Also, I do not mind the ugly URL’s for this specific function.

    So where does one add the $wp-rewrite code, and lets say I have a php page in my template called “results.php”, with 2 parameters (results.php?p1=a&p2=b) … is there a simple rule that tells WP that the page results.php (either in the root or in the theme dir) uses parameters and that it shouldn’t rewrite those?

    I added the following (and loads of variations):

    $wp_rewrite->non_wp_rules = array( ‘/results/([0-9]+),([ad]*),([0-9]{0,3}),([0-9]*),([0-9]*$)’ => ‘/results.php?q=$1&l=$2’ );

    to results.php (and on various other locations, in the root, in the template directory, with path etc.) but to no avail. 404 galore 😉

    thanks anyway for any input!

    Did anyone solve this? I think I have a similar problem…?

    it seems to be f****ed up in WordPress 2.6, the Feed Director plugin doesn’t work anymore…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘pretty urls and extra parameters’ is closed to new replies.