I am using WAMP and my url is localhost/hotel/hotels.php?id=21 Using rewrite rule as follow, Options +FollowSymLinks RewriteEngine on RewriteRule hotels/id/(.*)/ hotels.php?id=$1 RewriteRule hotels/id/(.*) hotels.php?id=$1 But nothing happens.. My mod_rewrite is on and also changes done in httpd.conf file. Please give me a suggesstion to handle the issue?
To me it seems like it should be done like this... Options +FollowSymLinks RewriteEngine on RewriteRule hotels/id/(.*)/ hotel/hotels.php?id=$1 RewriteRule hotels/id/(.*) hotel/hotels.php?id=$1 I mean where is the htaccess file located at? here? localhost/ or here? localhost/hotel/
actually though im no pro in htaccess, looking at my htaccess your missing 2 things, $ and ^ mine would look like this RewriteRule ^hotels/id/(.*)/$ hotel/hotels.php?id=$1 [QSA,L]
Please try the below code.... Options +FollowSymLinks RewriteEngine on RewriteBase /hotels/ RewriteRule ^id/([0-9a-zA-Z-]+)$ hotels.php?id=$1 [L] Code (markup): Also please check your server has mod_rewrite enable or not.....