Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在Yii框架上更改站点路径_Php_Apache_.htaccess_Yii - Fatal编程技术网

Php 在Yii框架上更改站点路径

Php 在Yii框架上更改站点路径,php,apache,.htaccess,yii,Php,Apache,.htaccess,Yii,我需要更改Yii web应用程序路径 我在这个路径上安装了Yii框架 .. htdocs\anasii\ 我在这个路径中创建了webapp 。。htdocs\anasii\anasii 我的站点路径现在是: 如何将此路径更改为: 我使用了.htaccess和httpd.config,并将配置文件设置为“urlFormat”=>“path”。 还有哪些步骤?在you yii install的主目录中有index.php,其中包含这两个路径 // change the following pat

我需要更改Yii web应用程序路径

我在这个路径上安装了Yii框架 .. htdocs\anasii\

我在这个路径中创建了webapp

。。htdocs\anasii\anasii

我的站点路径现在是:

如何将此路径更改为:

我使用了.htaccess和httpd.config,并将配置文件设置为“urlFormat”=>“path”。
还有哪些步骤?

在you yii install的主目录中有index.php,其中包含这两个路径

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

在yii安装的主目录中有index.php,它包含这两个路径

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

为了让它工作,我将我的站点文件夹直接放在htdocs中,所以它的路径是/htdocs/mysite。。关于Yii源,将框架文件夹从它复制到我的站点文件夹(媒体旁边,受保护,…文件夹),然后更改index.php,正如Adrin所说:

// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
无论你把它移到哪里都应该这样做。 更多信息,您需要编辑网站的.htaccess,以包括以下内容:

RewriteBase /
因为您的站点位于文件夹中,而不是直接位于htdocs上


当然,您还需要将您的httpd.conf配置为站点的新路径。

为了使其正常工作,我已将我的站点文件夹直接放在htdocs中,因此其路径为/htdocs/mysite。。关于Yii源,将框架文件夹从它复制到我的站点文件夹(媒体旁边,受保护,…文件夹),然后更改index.php,正如Adrin所说:

// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
无论你把它移到哪里都应该这样做。 更多信息,您需要编辑网站的.htaccess,以包括以下内容:

RewriteBase /
因为您的站点位于文件夹中,而不是直接位于htdocs上


当然,您还需要将您的httpd.conf配置为站点的新路径。

thx man但不起作用。。新的链接是有效的,但页面中的链接不起作用。。新链接可用,但页面中的链接不可用“在我从httpd vhost更改VirtualHost中的DocumentRoot链接后立即可用”在我从httpd vhost更改VirtualHost中的DocumentRoot链接后立即可用