I can not understand why RewriteRule , RewriteBase does not work.

Here is my .htaccess file:

  AddDefaultCharset utf-8 RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php 

In theory, if I write in the address bar http://mydomen.ru/hello , I have to go to the /controllers/HelloController.php folder. But 404 pages come to me

 Not Found The requested URL /hello was not found on this server. 

At the same time, when requesting home http://mydomen.ru/ , I connect the correct controller file, based on my routes. That is, everything works.

What am I doing wrong?

  • Understand with your router on php. All requests you have go to a single entry point into the index.php file. Further php should work on them. - Visman
  • Try RewriteRule ^(.*)$ index.php/$1 [L,QSA] - entithat
  • He tried the same thing - Dmitriy

0