Welcome to WebmasterWorld Guest from 54.197.116.116

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod_rewrite

   
11:01 pm on Nov 18, 2002 (gmt 0)



help

how do I change

domain.com/sports/article.pl?search=12345
and
domain.com/fitness/article.pl?search=654321

to

domain.com/sports/12345.htm
and
domain.com/fitness/654321.htm

Please help, I cant seem to find a close enough example anywhere on the web and I can't get my head around it.

11:12 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



marmalade,

Something like this should work:

RewriteCond %{QUERY_STRING} (.+)
RewriteRule (.*)/article.pl $1/%1.htm [L]

Jim

<edit> added ".htm"</edit>

[edited by: jdMorgan at 12:24 am (utc) on Nov. 19, 2002]

11:59 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteRule (.*)/([0-9])+\.html $1/article.pl?search=$2 [L,QSA]

does the reverse. This might be the thing you really want.

Andreas