Support » Plugins » Hacks » Rewrite custom dynamic pages (help)

  • I’m new to Apache rewrites. After reading and applying many examples, I cannot figure how to accomplish this rewrite situation. Any guru advice would be greatly appreciated.

    I have the standard WordPress rewrite block. This rewrites /help/ into index.php?page_id=123 just as it should.

    My help system builds pages based on query arguments, like this: /help/?h=monkey to show the help page for monkeys (for example).

    What I want to do is add a rule that allows me to rewrite /help/monkey/ into /index.php?page_id=123&h=monkey … but the &h=monkey part never works.

    I’ve tried adding this before the WordPress rewrite rules, as well as within (before the standard index.php rewrite). Here is a (broken) attempt:

    RewriteRule ^help/(.+)/?$ /index.php?page_id=123&h=$1 [QSA,L]

    I understand that I don’t understand. Please help me understand.

    (I’ve also looked into creating a plugin to augment the WordPress built-in rewrite system with additional rules, but that’s even more complicated, and I have no problem with hard-coding a rewrite rule for this case.)

  • The topic ‘Rewrite custom dynamic pages (help)’ is closed to new replies.