Reputation: 3866
I understand many variables outside what I can provide could be the problem, but I'm still asking if someone had this problem and could help.
Here's my UrlManager config in the components
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => false,
'showScriptName' => true,
'rules' => [
'' => 'site/index',
'member' => 'site/login',
],
],
This url works:
http://exampler.com/web/index.php?r=site/login
This url returns a 404
http://example.com/web/index.php?r=member
**NOTE: ** I don't have any messy Nginx or Apache rules on my server like this guy had. My rules seem to be completely ignored, whatever I write in them.
Upvotes: 0
Views: 92
Reputation: 22144
$rules
is ignored if you set $enablePrettyUrl
to false
. From $rules
documentation:
The rules for creating and parsing URLs when
$enablePrettyUrl
istrue
. This property is used only if$enablePrettyUrl
istrue
.
https://www.yiiframework.com/doc/api/2.0/yii-web-urlmanager#$rules-detail
Upvotes: 1