I am developing my app using xampp, and everything works fine there. But when I upload it on a host (hostinger) and try accessing a specific page I get a 404 error.
The button linking me to that page (from a different controller) has this as a url:
array(
'url'=>'Yii::app()->createUrl("symptomHistory/patientSymptomHistory",array("id"=>$data->primaryKey))',
(it’s a button in a gridview)
The action that it calls is the following:
public function actionPatientSymptomHistory($id)
{
//create model doctor request and search the database for a doctor request between the doctor user and
//the patient user
$doctorRequestModel = new DoctorRequests;
$doctorPatientRequest = $doctorRequestModel->findByAttributes(array('doctorID'=>Yii::app()->user->id, 'userID'=>$id, 'doctorAccepted'=>1));
//if there is an accepted doctor request between doctor and patient, show the patients's symptom history
if(isset($doctorPatientRequest))
{
$model = new Symptomhistory;
//model for the patients data
$patientModel = User::model()->findByPk($id);
//empty array to store all the user's symptoms
$symptomItems = array();
//find all symptomHistory records belonging to the user
$symptomHistoryModels = $model->findAllByAttributes(array('user_id'=>$id));
//loop through all the symptomHistory records that belong to the user
foreach($symptomHistoryModels as $symptom)
{
//switch case for event color. set color for each flag type
switch($symptom->symptomFlag)
{
case '1':
$symptomColor = '#A1EB86';
break;
case '2':
$symptomColor = '#CCCA52';
break;
case '3':
$symptomColor = '#F25138';
break;
default:
$symptomColor = '#36c';
}
//create event
$symptomItem=array('title'=>$symptom->symptomTitle,
'start'=>$symptom->dateSymptomFirstSeen,
'end'=>$symptom->dateSearched,
'symptomCode'=>$symptom->symptomCode,
'symptomHistoryID'=>$symptom->id,
'flag'=>$symptom->symptomFlag,
'color'=>$symptomColor
);
//copy symptomHistory event into array
array_push($symptomItems, $symptomItem);
}
//render patient history
$this->render('patientSymptomHistory',array(
'model'=> $model, 'patientModel'=> $patientModel, 'symptomHistoryEvents'=>$symptomItems
));
}
else //else throw exception
{
throw new CHttpException(403, 'You are not permitted to check this patient\'s Symptom History');
}
}
(sorry for the extra long code, but I honestly have no idea what might help and what might not).
I repeat I get a 404 error, not a 403 one.
Does anyone have any idea why I am getting this error? Thank you for your help