#Initialize mod_rewrite
RewriteEngine On
RewriteBase /
#Force "www" subdomain
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Re-route forbidden urls
RewriteCond %{REQUEST_URI} ^(system|application).* [OR]
RewriteRule ^(.*)$ index.php?/$1 [L]
#Re-route urls if file/directory does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
FYI: the forbidden urls section can be ignored in CodeIgniter 2.0 if you have the following .htaccess file in those folders…
thanks to share it !
I looked for the way to supress ‘index.php’ AND force WWW in htaccess file
You save my time !