Mod rewrite Apache重写引擎在子域上不工作
我正在使用Yii框架,在.htaccess中有以下代码:Mod rewrite Apache重写引擎在子域上不工作,mod-rewrite,yii,apache2,Mod Rewrite,Yii,Apache2,我正在使用Yii框架,在.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 我在URL管理器中使用以下代码来制作
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
我在URL管理器中使用以下代码来制作SEO-URL:
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
''=>'site/index',
'admin'=>'admin/default/login',
'<action:\w+>'=>'site/<action>',
array('page/view', 'pattern'=>'/<url:(\w|-)+>.html', 'caseSensitive'=>false),
array('category/view', 'pattern'=>'category/<url:(\w|-)+>', 'caseSensitive'=>false),
array('product/view', 'pattern'=>'product/<url:(\w|-)+>', 'caseSensitive'=>false),
),
'showScriptName'=>false,
),
'urlManager'=>数组(
“urlFormat'=>“路径”,
'规则'=>数组(
''=>'站点/索引',
“admin”=>“admin/default/login”,
''=>'站点/',
数组('page/view','pattern'=>'/.html','caseSensitive'=>false),
数组('category/view'、'pattern'=>'category/'、'caseSensitive'=>false),
数组('product/view','pattern'=>product/','caseSensitive'=>false),
),
'showScriptName'=>false,
),
它在我的本地计算机上运行得很好。但是当我尝试在我的VDS上应用它时,我得到了服务器,只有当此代码在子域上工作时,例如:我有blah-blah.com-此代码工作,但是如果我有new.blah-blah.com(这应该是不同的网站,与blah-blah.com没有任何共同点),我得到以下错误(内部服务器错误500):
内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求
请联系服务器管理员,[我的电子邮件]并通知他们错误发生的时间,以及您可能采取的任何可能导致错误的措施
有关此错误的详细信息,请参阅服务器错误日志
在apache的日志中,我找不到任何关于它的信息。您可以将错误记录到文件或发送到邮件 在config/main.php中
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
array(
'class'=>'CEmailLogRoute',
'levels'=>'error, warning',
'emails'=>'yourmail@yourdomain.com',
),
),
),
我已经记录了错误和警告,但问题是,我得到的正是apache的500错误页面,而不是Yii生成的内容。