0

通过参考以下网站:

http://myprogrammingtut.blogspot.in/2013/04/step-by-step-setup-yiiboilerplate.html

我在我的 ubuntu 12.10 操作系统中创建了两个虚拟主机。IE

yiibackend for yii backend and
yiifrontend for yii frontend

我在我的虚拟主机中为它们添加了路径,例如:

ServerName yiibackend
DocumentRoot /var/www/yiibootstrap/backend/www

ServerName yiifrontend
DocumentRoot /var/www/yiibootstrap/frontend/www

但是当我尝试打开时

http://backend.local

它正在工作并显示主页,但是当我单击任何其他链接时,它向我显示以下错误:

Not Found

The requested URL /site/page/ was not found on this server.
Apache/2.2.22 (Ubuntu) Server at yiibackend Port 80

请帮助解决这个问题。我是 yii 框架的新手,对它的结构不太了解。

谢谢

4

1 回答 1

0

I think you are forgetting the index.php so instead of calling directly /site/login call index.php/site/login

to remove the index.php , you have to add something like this

<IfModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

or check out http://www.yiiframework.com/wiki/214/url-hide-index-php/

于 2013-06-24T16:47:36.353 回答