首页 文章

htaccess不会在Kohana中重写index.php

提问于
浏览
0

我在谷歌搜索我的问题,但没有找到任何有用的信息 .

所以在将网站移至其他主机之前一切正常 . 这很好用

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [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]

但当我将网站删除到其他主机时,index.php不再重写 .

主机上的apache版本是2.2.22

登录到ftp时的文件结构是/ htdocs /和站点文件 .

当我在浏览器上写

http://verana.ge/index/page

它给了我404错误

但是

http://verana.ge/index.php/index/page/

效果很好

bootstrap配置是这样的:

'base_url'   => '/',
     'index_file' => FALSE,

所以,请帮助我告诉我,如果我做错了什么或它是apache配置问题或它是Kohana的问题

先感谢您

添加

还有一个细节

我联系了我的主机的sys admin,他给了我一个日志文件

/var/www/virtual/verana.ge/htdocs/.htaccess: RewriteLog not allowed here

在同一台主机上我有wordpress网站和它的htaccess文件loke像这样和工作

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /college/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /college/index.php [L]
</IfModule>

# END WordPress

请问请问我在哪里,问题是什么

添加

重写日志说

[verana.ge/sid#21cbdd98][rid#21e0ad78/initial] (3) [perdir /var/www/virtual/verana.ge/htdocs/] strip per-dir prefix: /var/www/virtual/verana.ge/htdocs/ ->

有任何想法吗?

1 回答

  • 0

    我解决了这个问题 .

    所以我的apache服务器版本是2.2.22,我做了htaccess文件,如下所示:

    IfModule mod_rewrite.c>    
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
     /IfModule>
    

    现在这个apache 2.2.22的htaccess配置运行良好

相关问题