0

也许这个问题已经在某个地方被问过,但我找不到适合我的问题的任何东西。

我正在使用 yii 及其 URL 管理器创建一个网站。在我的本地主机中,URL 管理器运行良好。但是在我将它上传到具有子域的服务器后,问题就出现了。域和子域应该是http://tokoandhika.mauinimauitu.com.

在我的本地主机中,http://localhost/tokoandhika/catalog/category1工作正常。它将访问CatalogController.php中的actionIndex 函数。但是如果我访问,它会提示 Internal Server Error (PHP Error 500)。http://tokoandhika.mauinimauitu.com/catalog/category1

可能出了什么问题?我需要编辑 htaccess 文件吗?还是我需要为此添加更多规则?任何有用的建议将不胜感激。

以下是我对 URL 管理器的规则:

'rules' => array(
            'category/<slug:[a-zA-Z0-9-]+>'                      => 'category/index',
            'page/<slug:[a-zA-Z0-9-]+>'                          => 'site/page/index',
            'gii'                                                => 'gii/default',
            'gii/<controller:\w+>/<id:\d+>'                      => 'gii/<controller>/view',
            'gii/<controller:\w+>/<action:\w+>/<id:\d+>'         => 'gii/<controller>/<action>',
            'gii/<controller:\w+>/<action:\w+>'                  => 'gii/<controller>/<action>',
            'gii/<controller:\w+>/<action:\w+>/id/<id:\w->'      => 'gii/<controller>/<action>/id/<id>',
            'catalog/addtocart/'                                 => 'catalog/addtocart',
            'catalog/detail/<slug:[a-zA-Z0-9-]+>'                => 'catalog/detail',
            'catalog/<cat:[a-zA-Z0-9-]+>/<subcat:[a-zA-Z0-9-]+>' => 'catalog/index',
            'catalog/<cat:[a-zA-Z0-9-]+>'                        => 'catalog/index',
        ),

这是我的htaccess:

RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
4

0 回答 0