> 1. how can i use mod_rewrite the url with .html extension from .php? by just add the code on .htaccess will do the whole work? can i have some samples here?
> for example, www.domainname.com/fold1/product.php?id=product-name&type=10 should rewrite to www.domainname.com/fold1/product-name_10.html
Actually, from your description of your problem, you probably want to rewrite the other way, from a static link (published on your pages) to a dynamic URL (used by your script). Mod_rewrite works after an HTTP request is received, but before any content handlers are invoked on the server, so it rewrites *incoming* URLs to the URLs needed inside your server. Mod_rewrite cannot change the links on your pages as they are served.
Samples here? Sure, do a search [google.com].
> by the way, here is a sample link which has high ranking on SE, do you think this is the result of mod_rewrite?
Please review the WebmasterWorld Terms of service [webmasterworld.com] and our charter [webmasterworld.com].
> 2. If i can use the way mod_rewrite to mask the urls and display as .html, they will have the same impact on search engines compare with the real .html page on server? which way will be better i use php to generate the html on the fly or just simply use .htaccess to do the mod_rewrite thing?
The usual approach is to publish static-URL links on your Web pages, and use mod_rewrite to convert those links, when requested, into the form needed to invoke your script. So, your pages have links on them like
www.example.com/hotel/sunset.html, but your script is invoked using URLs like www.example.com/index.php?accom=hotel&location=sunset
If you use this method, then as far as users and search engines are concerned, your URLs are static - there is no way they can see the underlying technology of how your server creates and serves pages. For example, look at the URL in your browser address bar right now. It appears to be a static page on WebmasterWorld, but this site is actually dynamic.
Please study the following documentation. These resources will help you get started, and give you the knowledge needed to discuss this project, understand the issues, and implement and maintain a good solution:
Apache mod_rewrite documentation [httpd.apache.org]
Apache URL Rewriting Guide [httpd.apache.org]
Regular Expressions Tutorial [etext.lib.virginia.edu]