rpaulpen
(Remopenn)
June 18, 2009, 6:06pm
1
Hello,
I implemented a simple version of friendly urls using the example in the guide, but seem to loose all my css and images. Looking closer, the image address is displayed as
http://onesearchp/in…_logo_left2.jpg
vs
http://onesearchp/cs…_logo_left2.jpg
It seems to be reading the path as in example one vs example two. I'm a little confused to why it's doing this.
My configuration file looks like:
'urlManager'=>array(
'urlFormat'=>'path',
),
I call the url by using something like
$this->render('services', array('content'=>$result['narrative'], 'pic'=>$pic));
What am I dong wrong please?
Thanks,
R
qiang
(Qiang Xue)
June 18, 2009, 6:25pm
2
What do your css/image tag look like?
rpaulpen
(Remopenn)
June 18, 2009, 7:35pm
3
Here is what the image tag looks like:
<?php echo CHtml::link(CHtml::image('css/new_logo_left2.jpg',Yii::app()->homeUrl),Yii::app()->homeUrl); ?>
qiang
(Qiang Xue)
June 18, 2009, 7:46pm
4
You should prefix it with Yii::app()->baseUrl. Otherwise, it may have the problem as you described under certain Apache configuration.
rpaulpen
(Remopenn)
June 18, 2009, 7:56pm
5
Changed the code as follows, but still the same problem.
<?php echo CHtml::link(CHtml::image(Yii::app()->baseUrl.'css/new_logo_left2.jpg',Yii::app()->homeUrl),Yii::app()->homeUrl); ?>
qiang
(Qiang Xue)
June 18, 2009, 8:04pm
6
You need a slash after baseUrl.
rpaulpen
(Remopenn)
June 18, 2009, 8:11pm
7
That fixed it. Thanks Qiang.
R