Abudayah
Abudayah

Reputation: 3875

Change site path on Yii Framework

I need to change Yii web app path.

I Installed Yii framework on this path .. htdocs\anasii\

and I created webapp in this path

.. htdocs\anasii\anasii

my site path now is:

http://anasii.com/anasii/

How can me change this path to:

http://anasii.com/

I used .htaccess and httpd.config and I set config file like this 'urlFormat'=>'path'. What steps remain ?

Upvotes: 0

Views: 8408

Answers (2)

Nimir
Nimir

Reputation: 5839

To get it work, i've put my site folder in htdocs directly so its path is /htdocs/mysite .. regarding the Yii source , copying the framework folder from it into my site folder (next to media , protected , .. folders) then changing index.php as Adrin said to:

// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

Should do it no matter where you move it. More over you need to edit .htaccess of your site to include this:

RewriteBase /

Since your site is in a folder and not directly on htdocs

Ofcourse you will need to configure your httpd.conf to the new paths of your site too.

Upvotes: 3

Adrian Cornish
Adrian Cornish

Reputation: 23848

In the main directory of you yii install there is the index.php which contains these two paths

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

Upvotes: 0

Related Questions