Answer the question
In order to leave comments, you need to log in
How to correctly write a regular expression in the urlmanager yii2 rules settings?
Hello, there is such a rule: It is '//<city>.domen.ru/search' => 'search/index',
necessary that city is not substituted if it is equal to moscow
I did this:
'//<city:^(?!moscow).*?>.domen.ru/search' => 'search/index',
Answer the question
In order to leave comments, you need to log in
config:
'//<city>.domen.ru/search' => 'search/index',
'//domen.ru/search' => 'search/index',
public function actionIndex($city='без поддомена'){
return $city;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question