Hi ! i need help related to mod_rewrite by .htaccess the scenario is dynamic url : localhost/cylinks/cat.php?id=4 static url : localhost/cylinks/cat/id/4 .htaccess file is saved in root directory (where index.php & cat.php exists) .htaccess contains:: Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / # Set the default handler DirectoryIndex index.php # URL rewrite rules <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ## Category redirect RewriteRule ^cylinks/cat/id/(.*)/$ /cat.php?id=$1 [L] </IfModule> but i'm getting 404 not found error. what's the problem ? please help ? i'm using apache 1.3.x .. is there any way to check if actually mod_rewrite module is working at my host/pc ?
/cat.php?id=$1 [L] Code (markup): Try removing the forward slash there. Or try this: cylinks/cat.php?id=$1 [L] Code (markup):
Your problem is in your absolute path to your cat.php file. /cat.php?id=$1 would actually be at localhost/cat.php?id=$1 Change it to match your path to the file, or, add a virtual host for the directory cylinks, so you can continue to develop on a 1-to-1 basis.