0

我的网站:

为什么我的 .htaccess 文件不起作用。我的框架是 CodeIgniter

Options -Indexes
Options +FollowSymLinks
RewriteEngine On
RewriteBase http://core01.0fees.net/exam/

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php?/$1 [L]

#When your application folder isn't in the system folder

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin   

ErrorDocument 404 /index.php
4

3 回答 3

1

尝试更改此行:

RewriteBase http://core01.0fees.net/exam/

对此:

RewriteBase /考试/

RewriteBase 选项使用来自 Web 根目录的相对路径。

于 2013-06-19T13:07:39.583 回答
0

如果您在 linux 环境下工作,请尝试将文件的首字母小写 (home/home.php) linux 环境区分大小写 Home.php 和 home.php 在 linux 中是不同的。你的问题很可能是这个

于 2013-06-19T21:14:42.450 回答
0

试试这个,我用它对我来说很好用。资产是我的应用程序文件夹的名称,您可以将其更改为您自己的。

RewriteEngine on
RewriteCond $1 !^(index\.php|uploads|images|css|js|lib|img|bootstrap|favicon|robots\.txt)
RewriteRule ^(.*)$ /asset/index.php/$1 [L]
于 2013-06-19T12:37:08.347 回答