newbie question

New to mod_rewrite? This is a good place to start.

newbie question

Postby anonymoussucker » Thu Jun 26, 2003 11:46 pm

So in all the examples I've seen they're using $1, $2, etc. Is there some way to search for some
regex, and then get everything in the url to the left and and right of it?

For instance, say my regex wants to find "foo" and my url is

http://gadzooks/egad/foo/bar/

i want $something to return /egad/ and $something-else to return /bar/. Is this possible?

-newbie
anonymoussucker
 

Postby Dark_Greg » Wed Jul 09, 2003 5:59 am

not sure what you are getting at...but in my (limited) experiance with such things, its upto your backend programming langauge to handle this...

lets say you are using PHP for instance...

using $PHP_SELF, and $DOCUMENT_ROOT you can rebuild the requested URL..you could also use $_SERVER['REQUEST_URI']. Then you use the explode() function to break the requested url up into useable chunks...
Dark_Greg
 


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 41 guests

cron