2012-04-18 123 views
1

我有笨1.7大的應用程序,我將其更新到2.1,但我有一個問題(404頁未找到)我目前的htaccess是:笨htaccess的

rewriteEngine on 
Options +FollowSymLinks 

rewriteRule ^admin(.*) index.php/admin$1 
rewriteRule ^supervisor/([0-9]+)(.*) index.php/supervisor_$1/$2 
rewriteRule ^(login|logoff)(.*) index.php/base/$1$2 
rewriteRule ^(files|attachment|meeting|thread|attachments|profile|search|roles|cat)(.*) index.php/moder/$1$2 
rewriteRule ^(about|contact|new_majlis|stats)(.*) index.php/page/$1$2 
rewriteRule ^(2.2-release-notes)(.*) index.php/page/release_notes 

你能幫幫我嗎?

+0

爲什麼你有'輸入代碼here' – allen213 2012-04-18 07:34:12

+0

對不起我第一次問問題 – 2012-04-18 07:37:11

+0

你需要一個更詳細一點。你要求什麼網址? – 2012-04-18 07:41:17

回答

0

首先,這樣的路由應該在你的application/config/routes.php文件來完成。我建議添加如下條目:

$route['supervisor/(:num)/(:any)'] = 'supervisor/$1/$2'; // This also looks hackish 
$route['login/(:any)'] = 'base/$1'; 
$route['logoff/(:any)'] = 'base/$1'; 


$route['about/(:any)'] = 'page/about/$1'; 
$route['contact/(:any)'] = 'page/contact/$1'; 
$route['new_majlis/(:any)'] = 'page/new_majlis/$1'; 
$route['stats/(:any)'] = 'page/stats/$1'; 
$route['2.2-release-notes/(:any)'] = 'page/stats/$1'; 

我還假設你想擁有「漂亮」的頁面;

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

這將確保笨處理所有請求:/管理,而不是/index.php/admin

爲了您.htaccess文件,您可以用替換上述所有。


對於你的404錯誤:

櫻桃採摘除了你config.php。不少事情發生了變化,所以最好使用vanilla 2.1版本,並使用之前從1.7版本中配置的變量進行填充。這同樣適用於application/config文件夾中的其他一些文件。

更改日誌是無休止有用的細節:http://codeigniter.com/user_guide/changelog.html

+0

仍然有404頁 – 2012-04-23 07:17:23

+0

檢查Apache的錯誤日誌。哪些網頁出現錯誤? – Seabass 2012-04-23 15:58:44

+0

它的工作非常感謝你的幫助 – 2012-04-25 10:50:59