RewriteEngine on RewriteRule dcp/([a-z0-9_]+)/([a-z0-9_]+)/(.*)$ index.php?_module=$1&_page=$2&$3 # Prevent calling internal php files RewriteCond %{REQUEST_FILENAME} .php!ibrowser.php RewriteRule ([a-z0-9_]+)(/[a-z0-9_])*/([a-z0-9_]+)\.php.*$ index.php # Prevent calling template files directly Deny from all