2016-04-26 110 views
0

我笨項目沒有工作我codeiginter項目運作良好,在本地主機(我使用Linux的交友)沒有的index.php在網上

https://localhost/project/profile

但沒有鏈接的index.php它不聯機工作

https://domainname.in/index.php/profile

.htaccess文件

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

route.php文件

$route['default_controller'] = "pages/home"; 
$route['404_override'] = ''; 
$route['pages/profile'] = "pages/profile"; 
$route['creators'] = "pages/userList"; 
$route['auth/logout'] = "auth/logout"; 
$route['auth'] = "auth/logout"; 
$route['auth/login'] = "auth/login"; 
$route['auth/register'] = "auth/register"; 
$route['pages/post'] = "pages/post"; 
$route[$username.'/about'] = "pages/menus/about"; 
$route[$username.'/credibility'] = "pages/menus/credibility"; 
$route[$username.'/release'] = "pages/menus/release"; 
$route[$username.'/jobs'] = "pages/menus/jobs"; 
$route[$username] = "pages/userList/userview/$1"; 
+0

的可能的複製[Codeiginter產品中的LocalServer工作良好,沒有的index.php,但在服務器不工作(http://stackoverflow.com/questions/36906066/codeiginter-product-worked-well-in-localserver -without-index-php-but-not-worked) – shruthi

回答

0

請嘗試與此有關。希望它會起作用。

與你的根

更新.htaccess.txt文件

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* index.php/$0 [PT,L] 
Options All -Indexes 
+0

並且在我的linux面板中沒有顯示.htaccess文件。如何查看和編輯.. – shruthi

+0

何處將htaccess文件放置在主文件夾或應用程序文件夾中 – shruthi

+0

沒有任何工作, – shruthi

0

創建.htaccess文件的項目文件夾內,我希望它的作品。

RewriteEngine on 
RewriteBase /projectfoldername/ 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt) 
RewriteRule ^(.*)$ /projectfoldername/index.php/$1 [L] 
相關問題