Welcome to WebmasterWorld Guest from 54.204.100.232

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod rewrite rule going wrong, for some reason.

loads wrong variable, and I'm tearing my hair out.

   
10:33 am on Apr 5, 2004 (gmt 0)

10+ Year Member



I have a php function that goes something like this:

replace (?<!/)viewtopic.php\?forum=([0-9]*)&thread=([0-9*]) with forum\\1/thread\\2.htm, which correctly changes the URLs to the forum[0-9]/thread[0-9].htm format, as expected.

I then have a rewrite rule that looks like this:
RewriteRule ^forum([0-9]*)/thread([0-9]*).htm viewtopic.php?forum=$1&thread=$2 which should, to my mind, use forum[0-9] to equal forum=[0-9] and ditto for thread. However, it doesn't. Instead of forwarding to the thread (via the thread= variable) it just loads the forum (via the forum= var) in the rewritten URL. I've checked the query string itself, and forum=1&thread=2 (for example) definately exists and points to a generated thread, so I can only assume that there is somethign wrong with my rewrite rule, only I can't see it :)

Can anyone help explain why it might do this?

10:37 am on Apr 5, 2004 (gmt 0)

10+ Year Member



Right, well, nevermind. Dismiss this post, I've realised the rewrite rule worked, it was just conflicting with another one (RewriteRule ^forum([0-9]*).* viewforum.php?forum=$1 for reference's sake). So hurrah.