EllisLab text mark
Advanced Search
     
Removing the “index.php” in URL
Posted: 17 November 2012 01:29 AM   [ Ignore ]
Joined: 2012-11-17
28 posts

Hi all,

I know this has been posted a lot of times. Problem is I searched through websites and forums and tried out all the possible solution for over a week, but none of them work.
My site name is ntumodules.com, I tried to test

http://ntumodules.com/viewreview/view/1 

without the index.php

http://ntumodules.com/index.php/viewreview/view/1 

but it just gives me 404 error.

My server is hosted at GoDaddy. I was told I need to enable some mod_rewrite thing but I have no idea how. I was also told that goDaddy server takes about 10 minutes to realize the changes. But I had waited over 1hr and there is still the error.

This are the files:

.htaccess (I put it in application folder)

<IfModule mod_rewrite.c>
  
RewriteEngine On
  RewriteBase 
/
  
  
RewriteCond %{REQUEST_URI} ^system.*
  
RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  RewriteCond 
%{REQUEST_URI} ^application.*
  
RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  RewriteCond 
%{REQUEST_FILENAME} !-f
  RewriteCond 
%{REQUEST_FILENAME} !-d
  RewriteRule 
^(.*)$ index.php?/$1 [L]
  
</IfModule>

<
IfModule !mod_rewrite.c>
  
ErrorDocument 404 /index.php
</IfModule

config.php

$config['base_url'"http://ntumodules.com/index.php/";
$config['index_page''';
$config['uri_protocol''REQUEST_URI'

Someone please enlighten me where I go wrong. Thank you very much.

 
Posted: 17 November 2012 02:21 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2009-02-19
3801 posts

The htaccess goes in the same dir that your index.php is located.

Try this htaccess.

RewriteEngine On
RewriteCond 
%{REQUEST_FILENAME} !-f
RewriteCond 
%{REQUEST_FILENAME} !-d
RewriteRule 
^(.*)$ index.php?/$1 [L] 

And change your base_url

$config['base_url'"http://ntumodules.com/"

/.htaccess
/index.php
/application
/system

/application and /system don’t need to be located in the same place, but if they get moved the path to them in index.php needs to be added.  Your root should at least have index.php and .htaccess.

 

 Signature 
 
Posted: 17 November 2012 03:44 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-04-15
453 posts

I don’t know if this is still relevant, but GoDaddy used to have an issue that was resolved by using:

Options -Multiviews
  Options 
+FollowSymLinks
  
  RewriteEngine On
  RewriteBase 
/

  
RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond 
%{REQUEST_FILENAME} !-d
  RewriteCond 
$!^(index\.php|images|robots\.txt|css|docs|js|system)
  
RewriteRule ^(.*)$ /index.php?/$1 [L] 

Try cronix’s fix first, especially with correcting your base_url, but if you are still having issues you might give that a shot

 Signature 

Code By Jeff

Mahana Messaging Library

Problem with your query? Did you run

$this->db->last_query(); 

before you came to the forums for help?

 
Posted: 18 November 2012 07:48 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2012-11-17
28 posts

Unfortunately, neither of your solutions work :(

My root folder has:

application
system
.htaccess
index.php

Inside application folder is where I put my View,Model,Controller.

Problem is I don’t know if this is the problem lies at the htaccess or the GoDaddy

 
Posted: 21 November 2012 09:19 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2012-11-17
28 posts

Any idea?

 
Posted: 23 November 2012 11:15 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-11-28
2435 posts

Remember to try different uri_protocol settings with different .htaccess - you just need to find the right combination.

 
Posted: 25 November 2012 04:42 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2012-09-20
15 posts

use this .. it’s work fine for me

RewriteEngine on
RewriteCond 
$!^(index\.php|images|uploads|resources|robots\.txt)
RewriteRule ^(.*)$ /codeigniter_folder_name/index.php/$1 [L] 

regards

 
Posted: 25 November 2012 04:44 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2012-09-20
15 posts

change config.php line :

$config['index_page''index.php'

to :

$config['index_page'''
 
Posted: 27 November 2012 12:40 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2012-11-17
28 posts

Just to confirm, is it true that GoDaddy takes some time to notice the changes, and where or what is this mod_write thing? I watch online tutorials but those are localhost, so they right-click on toolbar and enable it, but since mine is hosted on GoDaddy, how do I active it?