3

First off, before somebody posts this link, I will tell you I have looked through it and tried what it said to no avail. .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

I am using Codeigniter on a website and am attempting to get rid of the index.php in the URL. This code has been added to the .htaccess file in the root of my website.

 RewriteEngine on
 RewriteCond $1 !^(index\.php|images|robots\.txt)
 RewriteRule ^(.*)$ /index.php/$1 [L]

When I test it I get a 500 internal server error. Checking the error logs is says "Invalid Command 'RewriteEngine'". In the mods-enabled folder rewrite.load is listed. Also, I have restarted Apache after enabling rewrite.

Spent a few hours messing around with this and still have the same problem. Thanks in advance.

Source for .htaccess code: http://ellislab.com/codeigniter/user-guide/general/urls.html

Community
  • 1
  • 1
Dylan Buth
  • 1,648
  • 5
  • 35
  • 57

2 Answers2

1

"Invalid Command 'Rewrite Engine'"

Are you sure you don't have a space between "Rewrite" and "Engine" here? The htaccess syntax is not very forgiving when it comes to whitespace and having "Rewrite Engine" will definitely make it break.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • Positive, that is copied straight from the file, which was originally copied from codeigniter's website. Just to be sure though I just checked. – Dylan Buth Jun 29 '13 at 03:32
  • I'd have to agree with +Jon Lin that the error containing a space sounds odd and might be a tell at what is going on. Though if you've checked the .htaccess file I'm not sure where else to tell you to look. – Ben Jun 29 '13 at 12:11
1

There was an error starting Apache and when it was fixed everything worked. Thanks for the help anyway.

Dylan Buth
  • 1,648
  • 5
  • 35
  • 57