【问题标题】:website developed in kohana working in live but only home page working in localhost在 kohana 开发的网站在现场工作,但只有主页在 localhost 工作
【发布时间】: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' 键?

标签: php .htaccess kohana


【解决方案1】:

在您的 httpd.conf 文件中(可能在 /etc/httpd2/conf/ 中),更改

AllowOverride None

AllowOverride All

【讨论】:

    猜你喜欢
    • 2016-12-03
    • 1970-01-01
    • 1970-01-01
    • 2017-03-19
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多