RewriteCond %{REQUEST_URI} !^/index.php(.*) [NC] RewriteRule ^([A-Za-z0-9]+)\.php index.php?pag=$1 [L]