RewriteEngine on RewriteRule ^(config|res|script|setup)($|/) - [L] RewriteRule ^([a-zA-Z_]+)(\/([a-zA-Z0-9_]))?$ index.php?view=$1 [L,QSA]