如何在php中的htaccess中为此url应用重写规则

url:
http://www.kashmirmart.com/display.php?cat_id=52&subcat_id=53&name=Woolen_Shawls

here cat id , subcate id and name are always dynamic values

i want to rewrite like this:

http://www.kashmirmart.com/parentname/subcatname/page

for example:

http://www.kashmirmart.com/handicraft-industry/kashmir-craft/Woolen_Shawls 

handicraft-industry is parent kashmir-craft is subcategory under the handicraft-industry Woolen_Shawls is the last detailed page listed in kashmir-craft

plz give me solution as early as possible thanks

I'll give you an example...You can modify based on your requirements.

http://www.pets.com/show_a_product.php?product_id={a number}

And you want to change them to look like this:

http://www.pets.com/products/{a number}/

In order to do so, you will need to use "regular expressions". These are patterns, defined in a specific format that the server can understand and handle appropriately. A typical pattern to identify a number would look like this:

[0-9]+

The square brackets contain a range of characters, and "0-9" indicates all the digits. The plus symbol indicates that the pattern will idenfiy one or more of whatever precedes the plus - so this pattern effectively means "one or more digits" - exactly what we're looking to find in our URL.

The entire "pattern" part of the rule is treated as a regular expression by default - you don't need to turn this on or activate it at all.

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    ^products/([0-9]+)/?$    show_a_product.php?product_id=$1    [NC,L]    # Handle product requests