2016-04-26 108 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] 
相关问题