query string,Search engine friendly URLs

Apr 16, 2008 at 3:09 PM
I tried to make rewrite as example showed on http://stephenjungels.com/jungels.net/articles/mod-rewrite-recipes.html
------------------------------
Search engine friendly URLs

As you begin using programs written in PHP (for example) to serve dynamic content that is pulled from a database, your URLs may become much more complex. A URL for an article from a content management system in a particular category and subcategory might look like this:

http://www.example.com/index.php?cat=foo&subcat=bar

We would like to allow readers to find this article using the more friendly URL

http://www.example.com/foo/bar

The mod_rewrite recipe to accomplish this task is fairly simple:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(^/)/(^/)$ index.php?cat=$1&subcat=$2

Although these are called search engine friendly URLs, a primary goal of using them is to make your URLs friendly to your readers (easy to type and remember). In the opinion of the author, Google and Yahoo have many clever PhD's who are able to write a web robot that can crawl your site successfully even if you use dynamic URLs. Use friendly URLs anyways if they improve the user experience for your readers.

***********************
I want to make
http://www.example.com/index.php?cat=foo -> http://www.example.com/foo
but I cann't do it (although above example)
how I can do it by Ionics Isapi Rewrite Filter ?
***********************

-----------------------
note: I tried to debug on log file,It look strange
like

Wed Apr 16 20:04:26 2008 - HttpFilterProc SFNOTIFYURL_MAP
Wed Apr 16 20:04:26 2008 - OnUrlMap: storing physical path (c:\inetpub\wwwroot\test\), in ptr (0x0011fd00) <---- try 'test' as querysting
Wed Apr 16 20:04:26 2008 - HttpFilterProc SFNOTIFYAUTH_COMPLETE
Wed Apr 16 20:04:26 2008 - DoRewrites
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree: getting 'url'
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree - no joy (likely reason: server var not set yet) (GetLastError()=1413)
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree: 128 bytes
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree: result 'Z'
Wed Apr 16 20:04:26 2008 - GetServerVariableAutoFree: getting 'QUERYSTRING'
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree: 1 bytes
Wed Apr 16 20:04:26 2008 - GetServerVariable_AutoFree: result ''
Wed Apr 16 20:04:26 2008 - GetHeader_AutoFree: 4 bytes
Wed Apr 16 20:04:26 2008 - GetHeader_AutoFree: result 'GET'
Wed Apr 16 20:04:26 2008 - New Url: 'Z' <----------------------------- what is it?
Wed Apr 16 20:04:26 2008 - ApplyRules (depth=0)
Wed Apr 16 20:04:26 2008 - Rule 1 : -1 (No match)
Wed Apr 16 20:04:26 2008 - ApplyRules: returning 0
Wed Apr 16 20:04:26 2008 - No Rewrite

please help
THANKs