RewriteEngine on RewriteRule ^([a-z]+/([a-z|_|-]+))/?([0-9]+)?/?([a-z]+)?/?([a-z0-9_-]+)?/?([a-z]+)?/?([a-z0-9_]+)?/?([a-z]+)?/?([a-z0-9_]+)?/?$ /$1.php?$2=$3&$4=$5&$6=$7&$8=$9 [NC,QSA] REWRITE LOG (http://www.anti.dev/news/index/id/217) 127.0.0.1 - - [31/Jul/2007:12:46:43 -0700] [www.anti.dev/sid#181f6ac][rid#180ee34/initial] (3) [per-dir /Library/WebServer/Documents/anti_com/] add path-info postfix: /Library/WebServer/Documents/anti_com/news/index.php -> /Library/WebServer/Documents/anti_com/news/index.php/id/217 127.0.0.1 - - [31/Jul/2007:12:46:43 -0700] [www.anti.dev/sid#181f6ac][rid#180ee34/initial] (3) [per-dir /Library/WebServer/Documents/anti_com/] strip per-dir prefix: /Library/WebServer/Documents/anti_com/news/index.php/id/217 -> news/index.php/id/217 127.0.0.1 - - [31/Jul/2007:12:46:43 -0700] [www.anti.dev/sid#181f6ac][rid#180ee34/initial] (3) [per-dir /Library/WebServer/Documents/anti_com/] applying pattern '^/([^/]*)/([^/]*)/?([^/]*)/?([^/]*)/?' to uri 'news/index.php/id/217' 127.0.0.1 - - [31/Jul/2007:12:46:43 -0700] [www.anti.dev/sid#181f6ac][rid#180ee34/initial] (1) [per-dir /Library/WebServer/Documents/anti_com/] pass through /Library/WebServer/Documents/anti_com/news/index.php