2011-06-22 132 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的路徑河