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
in config
'urlManager' => [
'showScriptName' => false, //index.php hide/show:: in false index.php will remove from URL
'enablePrettyUrl' => true,
],
PrettyUrl uses pathInfo to specify the route. It is possible that your server configuration is not setup correctly to allow pathInfo to be passed to the application. You really need to find a log entry to tell you the exact error though, otherwise you are guessing.