Then in the backend/web folder I added and .htaccess file with this:
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
Actually since I added the url manager code I receive this error:
Invalid Call – yii\base\InvalidCallException
Setting read-only property: yii\web\Application::urlManager
1. in C:\xampp\htdocs\yii2\vendor\yiisoft\yii2\base\Component.php at line 195
186187188189190191192193194195196197198199200201202203204 foreach ($this->_behaviors as $behavior) {
if ($behavior->canSetProperty($name)) {
$behavior->$name = $value;
return;
}
}
}
if (method_exists($this, 'get' . $name)) {
throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::' . $name);
} else {
throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $name);
}
}
/**
* Checks if a property is set, i.e. defined and not null.
* This method will check in the following order and act accordingly: