Re: OT (kinda): Mod_rewrite
| From: | Wendell Brown | Date: | Wed, 02 Jul 2003 05:36:59 +0000 |
| Subject: | Re: OT (kinda): Mod_rewrite | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153672@lists.php.net to get a copy of this message | ||
On Tue, 01 Jul 2003 22:38:38 -0700, John wrote:
>When using mod_rewrite, is there any way to post variables from a form the
>way you want to.
>
>eg
>a text box called first name
>another textbox called second name
>action being http://www.searcher.com/search
>
>and the result being
>http://www.searcher/search/firstname/secondname
>
>is this possible?? i dont think so
Errrr... I'm not totally sure I understand what you are asking for, but
I do know the following should work:
1) Create a index.php file in the /search/ directory that expects two
"GET" parameters.
2) Set up the following mod_rewrite:
RewriteRule /search/([^/]+)/(.+)
/www/htdocs/search/index.php?First=$1&Last=$2
Should allow this:
> http://www.searcher.com/search/firstname/secondname
to call index.php as:
>
> http://www.searcher/search/index.php?First=firstname&Second=secondname
Hope this helps.