Forums

Walking on thin ice: mod_rewrite, templates and querystrings don't work together (3 posts)

  1. arthurl
    Member
    Posted 5 years ago #

    Hiya folks,

    I've been working on an plugin that enables me to add addresses to a database through the wordpress administrator interface and show it on our website. That all works fine - I made a custom template that calls the display function of my plugin and voila - I get a nice list of people on /people/.

    However, I tried extending it so I can use /people/$name/ instead of having to use /people/?str=$name to view the extended information for a person, but that won't work too well unfortunately - it throws me a 404.

    None of my rewrite rules will work, EXCEPT the numerical ones. So if I type /people/$id/ it works and redirects to /people/?id=$id:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^people/([0-9]+)/?$ people/?id=$1 [QSA,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    My mod_rewrite rules are probably the same as everyone else who's running 2.0.5 since I've tried different options and still got the same .htaccess file.

    Does anyone have any idea on how to solve things like this?

  2. Chris_K
    Member
    Posted 5 years ago #

    I'm afraid I don't have the answer, but as you surmised, WP does most of the rewriting internally these days.

    This plugin helps you "visualize" what those internal rules are. Perhaps it'll help you see what's going on? http://www.dagondesign.com/articles/wordpress-internal-rewrite-viewer-plugin/

  3. arthurl
    Member
    Posted 5 years ago #

    The plugin doesn't work for me unfortunately.

Topic Closed

This topic has been closed to new replies.

About this Topic