The site is on denwer and here is the contents of .htaccess:

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

the task is to remove the need to write in the address index.php / I use CodeIgniter. I can not get rid of this console enter image description here

  • and what is $1 first in RewriteCond ? Here in ReriteRule when $1 used, it’s understandable. that this is the content of the first group of matches in the regular schedule. After all, you probably wanted to check the query string, not the mythical $1 ? - teran
  • @teran honestly say understanding only on an intuitive level, I didn’t understand this - Nikolay

3 answers 3

Try replacing the contents of the file with the code below:

 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> 

Do not forget to replace in the file application / config / config.php:

 $config['index_page'] = "index.php" 

on

 $config['index_page'] = "" 
  • did as you said. But still a mistake. Sketched and pasted into the question description - Nikolay
  • There is already a need to look at the apache2 logs, which causes an error 500, it turns out that the .htaccess file is working and the error is already in the php code most likely - Yaroslav Molchan

fixed the error with the following code:

 <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 

    You have missed some condition. The given expression contains an invalid parameter.

     RewriteCond $1 !^(index\.php) 

    What is $1 ? Still there was no line parsing. What is this first argument?

    Because the server and gives an error

    PS noticed that I partially duplicate the comment teran.