Welcome Guest, Not a member yet? Register   Sign In
Removing index.php on CI
#1

[eluser]murali[/eluser]
Hi, i face some issue on CI 2.0.. about hosting problem.. i need some one help.. this is my first project developed using CI. so i face index.php issue in base URL.. ple help me... i used .ht-access file but that file cant removing index.php.. in localhost base_url working properly, but when i hosted base URL should not work without index.php. ex: www.mydomain.com/index.php/search.
.htaccess file...
RewriteEngine on
RewriteBase /mydomain.com
RewriteCond $1 !^(/index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(/index.php|css|images|js|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
i face page not found error...
if i use base_url in config file like $config['base_url']= 'http://www.mydomain.com/index.php'; the link should work properly..
please help me, how can i remove the index.php in CI framework when i hosted..
#2

[eluser]murali[/eluser]
Removing index.php issue on codeigniter
Hi, i face Removing index.php issue on CI 2.0...I need solutions for removing index.php on CI base URL..
I used .htaccess file
RewriteEngine on
RewriteBase /mydomain.com
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
but above code cant remove index.php on base_ .. When I run in local host base_ removed index.php and working properly, but when I hosted the project in web, default controller page only working.
1. My code:
:application/config/routes.php
$route['default_controller'] = "home";
:application/config/config.php
/* Base Site URL */
$config['base_']= '.mydomain.com/';
/*| Index File*/
$config['index_page'] = ' ';
/* URI PROTOCOL */
$config['uri_protocol'] = 'REQUEST_URI';
: .htaccess.txt
RewriteEngine on
RewriteBase /mydomain.com
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Result url: [ www.mydomain.com/search/ ]- page not found
2. Now I used alternate code:
: application/config/config.php
/* Base Site URL */
$config['base_']= '.mydomain.com/index.php';
Result url: [ www.mydomain.com/index.php/search/] – page working properly
How can I removing index.php in BASE_URL


#3

[eluser]InsiteFX[/eluser]
Code:
$config['BASE_URL']= 'http://www.mydomain.com/';
$config['index_page'] = '';

Also check to make sure you are running PHP 5 and that mod rewrite is turned on in php.ini
#4

[eluser]murali[/eluser]
Hi, Thank you for Ur response. project would be working properly in local host. But .htaccess couldn't working in web...
config:
$config['BASE_URL']= 'http://www.mydomain.com/';
$config['index_page'] = '';
$config[‘uri_protocol’] = ‘REQUEST_URI’;
.htaccess:
RewriteEngine on
RewriteBase /mydomain.com
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|css|images|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
when i use index.php in end of base_url ex: $config['BASE_URL']= 'http://www.mydomain.com/index.php'; base_url works properly.. i facing this issues on after host..





Theme © iAndrew 2016 - Forum software by © MyBB