Given that i have the following url in my site: http://localhost/test/example.php?a=1&b=2
How can i specify a redirect rule in my .htaccess file, such that this url is called when i enter the following in my browser: http://localhost/test/example/1.html
In other words, if a user enters the url: http://localhost/test/example/1.html, he should be displayed the page: http://localhost/test/example.php?a=1&b=2
I have tried the following mod_rewrite code in my .htaccess file, but it does not work:
RewriteRule ^/([^/]+).html /example.php?a=$1&b=$2 [QSA]
This is the code in my .htaccess file:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)/? /example.php?a=$1&b=$2 [QSA]
Note: I am using WAMP2.0, Apache 2.2.6 and PHP 5.2.5