【发布时间】:2014-12-28 05:22:14
【问题描述】:
我有一个在 kohana 开发的网站。该网站在现场运行良好。我在本地主机中制作了本地副本,只有主页在本地工作。所有其他页面都显示以下错误
找不到
在此服务器上找不到请求的 URL /demo/search-ad/search-detail.html。 Apache/2.2.15 (CentOS) 服务器在 localhost 端口 80
我将所有文件放在一个文件夹 demo 中,我的 .htaccess 文件更改如下
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /demo
# Protect application and system files from being viewed
RewriteRule ^(application|system) - [F,L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]
#RewriteRule ^(.*)$ index.php?/$0 [L]
【问题讨论】:
-
本地机器上是否启用了 mod_rewrite?
-
在 bootstrap.php 中设置正确的 'base_url' 键?