Forum Moderators: phranque

Message Too Old, No Replies

Mod rewrite regex help

Looks like my query should work but it doesn't

         

FiZiX

3:42 pm on Jun 25, 2007 (gmt 0)

10+ Year Member



Hello,

I've written my .htaccess file and have almost all of it working except for one part. I need a URL like this:

[localhost...]

To be converted in to a working GET statement. /page/2/ does not exist but is a virtual directory using mod_rewrite. The GET portion of the statement is being sent by a form. Here is the regex I'm trying to use:

RewriteRule ^([^/]+)/([^/]+)/\?([^=]+)=([^&]+)?&([^=]+)[=](.*)[&?]$ /?$1=$2&$3=$4&$5=$6

Can anybody tell me why this isn't working?

Thanks,
Ian

jdMorgan

4:04 pm on Jun 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Query strings are not available for direct testing by RewriteRule. You will need to use a RewriteCond to test %{QUERY_STRING} for name/value pairs and to create back-references to them.

See the Apache documents and tutorials cited on our forum charter [webmasterworld.com] page.

Jim

anjanesh

9:00 am on Jun 27, 2007 (gmt 0)

10+ Year Member



Same question asked by me sometime ago.
Link [webmasterworld.com]