我在codeiginiter中创建了一个项目
那是在没有index.php(localhost / sample)的本地服务器上工作的 但是,当我升级到在线服务器(cpanel linux)时,默认控制器只能工作,其他下一页网址不起作用..(https://sample/nextpage)
如果我给index.php意味着工作(https://sample/index.php/nextpage)
我想删除index.php,请帮帮我..
我的config.php
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'REQUEST_URI';
我的 route.php 文件
$route['default_controller'] = "pages/home";
$route['pages/profile'] = "pages/profile";
$route['creators'] = "pages/userList";
$route[$username] = "pages/userList/userview/$1";
$route['translate_uri_dashes'] = FALSE;
$route['404_override'] = '';
我的.htaccess文件
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
Options All -Indexes
先谢谢,
Shruthi。
答案 0 :(得分:2)
尝试使用以下
更改.htaccess文件的代码RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
答案 1 :(得分:2)
更改.htaccess文件
RewriteEngine On
RewriteBase /name of project folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
答案 2 :(得分:2)
试试这个
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond $1 !^(index\.php|img|css|public|tmp|download|javascript|rte|document|xajax_js|robots\.txt)
答案 3 :(得分:2)
请联系您的托管服务提供商并检查mod_rewrite模块是否启用?