<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{http_host} ^(www.)?domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] Redirect permanent /wap http://m.domain.com RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] <IfModule>