shaan360
(Shaanmk)
June 5, 2012, 8:27am
1
I am following this wiki Written by: qiang to define directory structure.
yiiframework.com/wiki/155/the-directory-structure-of-the-yii-project-site/
when i want to access frontend i have to write 127.0.0.1/newcms/frontend/www/ the whole path. Is there a way to hide www and fronted from the url . i.e 127.0.0.1/newcms/frontend/ or just 127.0.0.1/newcms/
thanks
use this
Yii::app()->request->baseUrl/…
$_SERVER[‘DOCUMENT_ROOT’].Yii::app()->request->baseUrl.’/patients/’;
rookie84
(Lifeline Is)
June 5, 2012, 9:28am
4
Not sure if this is what you want but adding a .htaccess in the very root of the directory structure will do:
RewriteEngine on
RewriteRule (.*) frontend/www/$1
That routes http://localhost/index.php to http://localhost/frontend/www/index.php
or set path in main config file
Yii::setPathOfAlias(‘frontend’,FRONT_END);
also u can define path in index like
define(‘FRONT_STORE’,dirname(dirname(FILE )).DIRECTORY_SEPARATOR.‘frontend’);
or
define(‘WIDGETS’,‘protected/common/widgets’);
thnx sir this is working properly: Excellent
shaan360
(Shaanmk)
June 6, 2012, 7:01am
7
Rajith thank you it worked .
shaan360
(Shaanmk)
June 6, 2012, 7:02am
8
or set path in main config file
Yii::setPathOfAlias(‘frontend’,FRONT_END);
also u can define path in index like
define(‘FRONT_STORE’,dirname(dirname(FILE )).DIRECTORY_SEPARATOR.‘frontend’);
or
define(‘WIDGETS’,‘protected/common/widgets’);
this is what i was looking for . thanks
shaan360
(Shaanmk)
June 6, 2012, 7:04am
9
Rookie i was trying to avoid htaccess . yes works but i wanted to do it through url path manager .
thanks for your reply and help