繁体   English   中英

htaccess不会在Kohana中重写index.php

[英]htaccess doesn't rewrite index.php in Kohana

我在Google中搜索了我的问题,但未找到任何有用的信息。

因此,在我将该站点移至其他主机之前,一切正常。 这很好

# 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/

效果很好

引导程序配置是这样的:

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

所以请帮助我,告诉我我做错了还是Apache配置问题还是Kohana的问题

先感谢您

添加

还有一个细节

我联系了我主机的系统管理员,他给了我日志文件,上面写着

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

在同一台主机上,我有wordpress网站及其htaccess文件,像这样工作

# 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/ ->

有任何想法吗?

我解决了这个问题。

所以我的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>

现在这个htaccess apache 2.2.22的配置很好

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM