This is as far as I was able to get with Mod_Rewrite. The only problem with this is that the rewrite works only if someone types in the url. I need the code in .php to stop outputting dynamic urls. See this link to understand
Rewrite TipsOptions +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^detail-([0-9]+)\.html$ detail.php?listing=$1 [L]
If you type in
http://www.yourdomain.com/detail-32.html, mod_rewrite will redirect
http://www.yourdomain.com/detail.php?listing=32 with the .html in the url. Even though the link looks like html its actually the php link.
As far as some uses I also used this code. And then changed main links in index.html. For example the link, "buy.php" --- instead of using this link I changed it to "buy-homes". Mod_rewrite then redirects this link to buy.php and shows
www.yourdomain.com/buy-homes in the url.
#Rewrite Navigation Links
RewriteRule ^buy-homes/?$ buy.php? [L]
Hope this helps! All I need now is to figure out how to change the output in .php. Here is another useful link for
tips and tricks.
David