hi all i have my url as http://localhost/vineet/products.php?dealer_id=12&category_id=2 Code (markup): i want to have it like this http://localhost/vineet/products/dealer_id/12/category_id/2 Code (markup): i m using the folowing lines in htaccess file Options +FollowSymlinks RewriteEngine On RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)$ products.php?dealer_id=$1&category_id=$2 [L] Code (markup): but when i type in my browser http://localhost/vineet/products/dealer_id/12/category_id/2 Code (markup): i get 404 error. object not found vineet
I don't think you can have the URL in the above mentioned layout. But yes, I just THINK you cannot. Who knows ?
You may want to change it to following: /vineet/products.php?dealer_id=$1&category_id=$2 [L] Code (markup): Check your error_log to see what is the rewritten URL and you will be able to fix it quickly.
RewriteEngine On RewriteRule ^vineet/dealer_id/([^/]*)/category_id/([^/]*)$ /vineet/products.php?dealer_id=$1&category_id=$2 [L] It should work
If you are actually doing this on localhost, make sure you have mod_rewrite enabled in your httpd.conf
hi gikone i tried your code RewriteEngine On RewriteRule ^vineet/dealer_id/([^/]*)/category_id/([^/]*)$ /vineet/products.php?dealer_id=$1&category_id=$2 [L] Code (markup): and typed in my browser http://localhost/vineet/products/dealer_id/12/category_id/2 Code (markup): i m putting htaccess file in vineet folder. and received error 404 object not found. i have mod_rewrite enabled in your httpd.conf vineet