Answer the question
In order to leave comments, you need to log in
How to remove characters from url?
Good time! I have a website written with Yii.
The problem itself:
When a user logs in and enters the personal account, his url is like: site.com/c/id123, you need to make the ID itself, i.e. the numbers were not visible.
Tried hiding via .htaccess - didn't work. I ask for your help.
Thanks for your reply, all the best
Answer the question
In order to leave comments, you need to log in
You redirect after logging in to the personal account, keep user_id in the session, why do you need to pass it as a parameter.
if ($user_model->is_logged){
$this->redirect(array('c'));
}
public function actionIndex(/*$user_id - сюда не передаешь*/)
$user_id = Yii::app()->user->get('id');
/*или*/
$user_id = $_SESSION['user_id'] /*в зависимости как ты там хранишь*/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question