2017-06-08 53 views
0

從XAMPP服務器中刪除我的笨項目到Live服務器我有沒有嘗試在前面的index.php來訪問我的主頁時出現錯誤後..笨的index.php錯誤

這是我的路線:

$route['home'] = 'Pages/view/home'; 

這是我的配置:

$config['index_page'] = ''; 
$config['base_url'] = 'http://mysite/newsite'; 
$config['uri_protocol'] = 'REQUEST_URI'; 

我的.htaccess文件:

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php/$1 [L] 

所以當我嘗試衝浪www.mysite /家用它給了我這個錯誤:

請求的URL /index.php/home此服務器上找到。

此外,在嘗試 使用ErrorDocument來處理請求時遇到404未找到錯誤。

但是當我衝浪www.mysite/index.php文件的/ home它的工作

我嘗試了不同的htaccess中,但沒有成功

+0

喜,在你的htaccess你需要改變'重寫規則^(。*)$ /index.php/$1 [L]''到RewriteRule ^(。*)$ /newsite/index.php/$1 [L]' – elddenmedio

+0

@elddenmedio謝謝!像魅力一樣工作! –

回答

0

我與寡婦10我用這兩個XAMPP

RewriteEngine on 

# Next two lines get rid of trailing slash 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)/$ $1 [L,R=301] 

RewriteCond $1 !^(index\.php|resources|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

而且

Options +FollowSymLinks 
Options -Indexes 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

也有自己的基本網址我會把/在它的結束

$config['base_url'] = 'http://localhost/yourproject/';