I have this configuration

'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => require(__DIR__ . '/urls.php'), ] 

if he comes to the home, he handles everything well. but if on any other page of the form

 http://site.ru/register или http://site.ru/main 

says Not Found screen

what could be the problem?

  • Show what you have in the file urls.php - Bookin
  • urls.php file - yadi.sk/d/Wn2_igNsvLfua - Diefair
  • Have you added .htaccess to the project? - Bookin
  • not. Can you tell me how to do this? - Diefair

1 answer 1

Create next to index.php , in the web folder, the file .htaccess , and write in it:

 RewriteEngine on # If a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Otherwise forward it to index.php RewriteRule . index.php 
  • thanks a lot , helped - Diefair