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

Apache Web Server Forum

    
Mod_rewrite regexp
cz_keeper




msg:1515593
 6:05 pm on Aug 6, 2003 (gmt 0)

Hi,

I've just started to play with mod_rewrite in Apache.
I've following situation: I want to change this address:


main.php?load=store&filter=flowers&from=0&rows=20

to something like this:


category/store/filter/flowers/from/0/rows/20/

but the address should also be only:


main.php?load=store

or


main.php?load=store&from=0&rows=20

or


main.php?load=store&filter=flowers

Can somebody help me to create regexp, which will fit all this "situations", if it's possible.

Thank you

 

DaveAtIFG




msg:1515594
 6:27 pm on Aug 6, 2003 (gmt 0)

This ain't the regex help desk! ;) :)

Here are some great resources. Do some reading and someone will probably help you debug YOUR solution if necessary.

[etext.lib.virginia.edu...]
[sitescooper.org...]
[regexlib.com...]

jdMorgan




msg:1515595
 11:33 pm on Aug 6, 2003 (gmt 0)

cz_keeper,

...And we should point out that the usual application of mod_rewrite is to rewrite static URLs to dynamic URLs for input to your scripts. Your scripts and pages output links like category/store/filter/flowers/from/0/rows/20/ for users and robots to see and link to, and mod_rewrite is then used to convert these into the form needed to call your script when one of these static URLs is requested.

That is, mod_rewrite is used to translate an http request for [yourdomain.com...] into a request for /main.php?load=store&filter=flowers&from=0&rows=20 and activate your php script.

Jim

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