0

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

10
  • What version of CodeIgniter are you using? Commented Jan 3, 2014 at 20:50
  • Which URL are you trying? Commented Jan 3, 2014 at 20:51
  • Codeigniter version is 2.1.x Commented Jan 3, 2014 at 20:57
  • Anubhava the url i am trying would be qa.test.com/login instead of qa.test.com/index.php/login Commented Jan 3, 2014 at 20:58
  • 1
    ok that means mod_rewrite isn't enabled in your Apache config. Commented Jan 3, 2014 at 21:34

1 Answer 1

1
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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.