views:

111

answers:

1

Need help with .htaccess - not able to get what i want...

Ugly URL - http://www.onnlist.com/punerealestate.jsp?section=realestate&file=pune

Want Better URL (such as) - mysite/realestate/pune/punerealestate.html

here is my latest .htacess file - of course this does not work -

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^products/([^/]+)/([^/]+).html /punerealestate.jsp?section=$1&file=$2 [L]
RewriteRule ^aboutus.jsp/$ /pages/about.html [L]

Edit: I just tried Fabian's solution. I copied the 3 lines into the .htaccess file in the root directory of my website but it is still not working. Any ideas?

A: 

The following example will rewrite http://www.onnlist.com/bla1/bla2/punerealestate.html to http://www.onnlist.com/punerealestate.jsp?section=bla1&file=bla2

    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^([^/]+)/([^/]+)/punerealestate.html /punerealestate.jsp?section=$1&file=$2 [L]
Fabian