2011-06-22 133 views
0

我已经将所有本地Intranet站点移动到具有新DNS的新服务器上。更改设置和配置文件后,似乎一切正常。
就是讨厌我的唯一的事情是,我不能让旧服务器Codeigniter删除/index.php/class

http://intrenet/trunk/class 

工作正常上摆脱

http://intranet/trunk/index.php/class ,但现在它抛出了

在此服务器上未找到请求的URL/trunk/class /。

但正如我所说的,使用/index.php/class时工作正常。这应该是可以解决的.htdocs(我已经放在中继文件夹中,是不是?)

我也改变了所有的codeigniter配置。

回答

3

首先确保在您的Web服务器中启用了URL重写(mod_rewrite)。 然后用下面的代码在htdocs目录中创建一个.htaccess文件。

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

,还可以编辑config.php文件并删除的index.php enter image description here

+0

我已经完成了.htaccess和索引文件的删除操作,将检查mod-rewrite是否被启用并回复给你! – jdborg

+0

好吧,现在所有3个似乎都没问题,但仍然没有重新定向。 – jdborg

0

我有同样的问题,我和这个.htaccess文件解决

# Mod Rewrite active 
<IfModule mod_rewrite.c> 
    # Set base path 
    RewriteEngine On 
    RewriteBase /Workspace/codeigniter/ 

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

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

    # Check for error request 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

# Mod Rewrite inactive 
<IfModule !mod_rewrite.c> 
    ErrorDocument 404 /index.php 
</IfModule> 

记得设置

$config['index_page'] = ''; 
$config['uri_protocol'] = 'AUTO'; 

在config/config.php文件中并更改“RewriteBase”va的路径河