Forum Moderators: phranque

Message Too Old, No Replies

please help! mod_rewrite and passing variables

         

creativevisions

7:56 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



i have mod_rewrite installed on my apache server, and whereas my other rules work, the following doesn't seem to work. i have miva empresa running on my machine, and it appears that it is not picking up on the variables i would like to pass in the rewritten URLs.

RewriteCond %{REQUEST_URI} ^/.*\.html\?.*$
RewriteRule ^(.*)\.html\?(.*)$ /index.mv?doc=$1&$2 [L]

supposedly, this rule would change this URL:
mydomain.com/item1.html?mode=ext
to:
mydomain.com/index.mv?doc=item1&mode=ext

miva receives the 'doc' variable, but not the 'mode' variable. is the rule written incorrectly?

thank you in advance for any help,

Creative Visions

jdMorgan

9:10 pm on Jun 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Query strings (everything following the "?") are not part of the URI; They are parameters to be passed to the resource at that URI. So the problem is that you'll need to use %{QUERY_STRING} instead of %{REQUEST_URI} to access those variables and pass them with a back-reference to your substitution URI.

Apache mod_rewrite documentation [httpd.apache.org]

Jim

WhosAWhata

9:30 pm on Jun 3, 2004 (gmt 0)

10+ Year Member



sorry about that,
my problem
i'll do that next time