NYCPHP Meetup

NYPHP.org

[nycphp-talk] OT? reverse mod_rewrite

michael lists at genoverly.net
Mon May 15 09:48:29 EDT 2006


I'm trying to keep 'pretty' urls on this small webiste I'm working on.

I have a page that presents 'our stores' in the 50 US States, so users
can find one. The page opens and there is select box for states.  The
user selects one and hits GO (form action=post)  The stores are listed,
grouped by city and ordered by store.  The store name are actually
links; when clicked it shows store details like address, hours, etc.

Those store links are done in 'pretty form'.  I wrote the rewrite rules
to break up an incoming request like this: 
	/root/find/state/city/store_id ..into..
	index.php?NAV=store_finder;STATE=state;CITY=city;SID=store_id

Every is working well.  My problem is cosmetic.. after selecting a store
and viewing the information, the pretty url is in the browser bar.  If
the user selects a new state, the form works (I capture the post in
PHP), but the browser bar still shows the previous request.

This was way-to-much info to ask.. 

How do I capture GET/POST variables in mod_rewrite so I can use them?

I know I could change the 'form action=get' and there is a {QUERY
STRING} available to me in mod_rewrite, but I could not figure out how
to get the vars out of it BEFORE it gets passed along.  I need to
reverse; ?selected_state=NY ..into.. /root/find/NY .. and let existing
rules take over.

Can anyone give a nudge in the right direction?

-- 

michael



More information about the talk mailing list