需要htaccess重定向子域

I have a subdomain qa.test.com and codeigniter is installed on that subdomain, however I can't seem to get rid of the index.php in the url with this rule in .htaccess

RewriteEngine On
RewriteCond $1 !^(index\.php|public|user_guide|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

Can someone help me with removing index.php from a subdomain type url.

Figured it out I did not have mod_rewrite enabled

sudo a2enmod rewrite and then restart apache

RewriteEngine On
RewriteCond $1 !^(index\.php|public|user_guide|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

This is correct although you also have to have mod rewrite enabled, to enable mod rewrite run this command

sudo a2enmod rewrite

and don't forget to restart apache

sudo service restart apache2