Can't get it to re-direct

Jun 13, 2008 at 7:56 PM
Before I begin, please let me say that I HAVE read all of the examples, the readme file, and cannot run the test.exe on my server...

That being said...

Here is what I am trying to do, and it is not working correctly...
I would like:
http://www.domain.com/results/?search_query=chris
to go to:
http://www.domain.com/result/chris

Can anyone please help with this? It must be a simple fix...

My current .ini:

RewriteLog  c:\temp\iirfLog.out
RewriteLogLevel 5
MaxMatchCount 10
RewriteFilterPriority HIGH
RewriteRule ^/result/$ /results/?search_query=$1[U,L]

My last log entry:

Fri Jun 13 12:48:36 2008 - DoRewrites: No Rewrite
Fri Jun 13 12:48:39 2008 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Jun 13 12:48:39 2008 - OnUrlMap: storing physical path (C:\Inetpub\wwwroot\VHOSTS2\LatestYouTubeVideos\result\chris), in ptr (0x066e1c70)
Fri Jun 13 12:48:39 2008 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Fri Jun 13 12:48:39 2008 - DoRewrites
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: getting 'url'
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: 128 bytes
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: result ''
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: getting 'url'
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: 14 bytes
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: result '/result/chris'
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: 1 bytes
Fri Jun 13 12:48:39 2008 - GetServerVariable_AutoFree: result ''
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: getting 'method'
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: 4 bytes
Fri Jun 13 12:48:39 2008 - GetHeader_AutoFree: result 'GET'
Fri Jun 13 12:48:39 2008 - DoRewrites: New Url: '/result/chris'
Fri Jun 13 12:48:39 2008 - ApplyRules: depth=0
Fri Jun 13 12:48:39 2008 - ApplyRules: Rule 1 : -1 (No match)
Fri Jun 13 12:48:39 2008 - ApplyRules: returning 0
Fri Jun 13 12:48:39 2008 - DoRewrites: No Rewrite

Thank you in advance!

Coordinator
Jun 14, 2008 at 5:58 AM
Edited Jun 14, 2008 at 6:01 AM
Your rule doesn't make sense.

  RewriteLog  c:\temp\iirfLog.out
  RewriteLogLevel 5
  MaxMatchCount 10
  RewriteFilterPriority HIGH
  RewriteRule ^/result/$    /results/?search_query=$1  [U,L] 

The Regex says "match any URL that is EXACTLY "/result/"  .  The ^ means "beginning of line" and the $ means "End of line". 

And in your replacement string you have the $1 which implies that you want to capture a string, but you haven't captured anything.  There are no parens in the regex....
I think what you want is something like

   RewriteRule ^/result/(.+)$    /results/?search_query=$1  [U,L]

You might want to check out the examples page.
Also, I don't know what you mean by "I want X to go to Y".
What is the URL that will be typed into the browser?
What is the URL you would like to map it to on the server?

The rule that I gave you allows a user to type in
   http://server/result/chris

and then on the server, the URL gets mapped to  
  http://server/results/?search_query=chris