homepage Welcome to WebmasterWorld Guest from 54.227.12.4
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
mod_rewrite
marmalade




msg:1512026
 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.

 

jdMorgan




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

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]

andreasfriedrich




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

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

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

Andreas

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved