将Apache URL重写转换为Hiawatha for Codeigniter

时间:2014-03-04 19:05:41

标签: apache codeigniter mod-rewrite hiawatha

我在Apache2上安装了Codeigniter。试图在Hiawatha上运行它(在Puppy Linux上)。将Codeigniter应用程序与数据库一起移动到Hiawatha并更新了所有设置。但是,我无法在Hiawatha上运行应用程序。它会抛出404错误页面。

虽然我不确定这是否是URL Rewrite的问题?

在Apache2上运行.htaccess URL重写:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

如何将其转换为与Hiawatha一起使用?

在Hiawatha官方网站上尝试过下面提到的,没有运气(Hiawatha仍然会抛出404错误页面):

UrlToolkit {
ToolkitID = codeigniter
RequestURI exists Return
Match ^/(index\.php|images|robots\.txt) Return
Match .* Rewrite /index.php
}

请帮忙。提前谢谢。

1 个答案:

答案 0 :(得分:0)

将urlToolkit设置添加到hiawatha配置文件后,我需要在通过localhost访问应用程序时将以下行插入虚拟主机(localhost):

UseToolkit = codeigniter

有效!

然后我将CodeIgniter移动到子目录/ codeigniter /。为此,我必须修改UrlToolkit中的以下行:

Match .* Rewrite /codeigniter/index.php

现在一切都很完美。

相关问题