Welcome Guest, Not a member yet? Register   Sign In
Removing the "index.php" in URL
#1

[eluser]Volkof[/eluser]
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

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

without the index.php

Code:
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)
Code:
<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
Code:
$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.
#2

[eluser]CroNiX[/eluser]
The htaccess goes in the same dir that your index.php is located.

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

And change your base_url
Code:
$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.
#3

[eluser]jmadsen[/eluser]
I don't know if this is still relevant, but GoDaddy used to have an issue that was resolved by using:

Code:
Options -Multiviews
  Options +FollowSymLinks
  
  RewriteEngine On
  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(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
#4

[eluser]Volkof[/eluser]
Unfortunately, neither of your solutions work Sad

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
#5

[eluser]Volkof[/eluser]
Any idea?
#6

[eluser]Aken[/eluser]
Remember to try different uri_protocol settings with different .htaccess - you just need to find the right combination.
#7

[eluser]ahmed.alsiddig[/eluser]
use this .. it's work fine for me
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|uploads|resources|robots\.txt)
RewriteRule ^(.*)$ /codeigniter_folder_name/index.php/$1 [L]

regards
#8

[eluser]ahmed.alsiddig[/eluser]
change config.php line :
Code:
$config['index_page'] = 'index.php';

to :

Code:
$config['index_page'] = '';
#9

[eluser]Volkof[/eluser]
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?




Theme © iAndrew 2016 - Forum software by © MyBB