Welcome Guest, Not a member yet? Register   Sign In
INDEX.PHP not being removed. . . .I've tried everything!!
#1

[eluser]4waymedia[/eluser]
Hello,....Please Help! This is driving me nuts! I DO NOT want to have index.php in the url....It looks tacky and messy.

I'm using .htaccess and it just create problems. 404 error NOT FOUND, and also redirects to apache listing projects page, but is broken. I have tried the htaccess in all directories. How do I make it work?

my config.php has:

Code:
$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
my .htacces is:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]


**** my setup ****
I'm running the following:

WINDOWS VISTA SP1
WAMP SERVER 2.0
PHP 5.3.0
APACHE 2.2.11
rewrite module is active

I have WAMP at c:/wamp

and access my codeigniter by:
c:/wamp/www/ci_test/

url is:
localhost/ci_test/

******* end setup *********

this is driving me nuts!! I surprised that this is not a STANDARD feature for CI. I've read and practiced various suggestions on the net for this, but nothing is working.

Help me please....
#2

[eluser]DBPolito[/eluser]
I use:

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

[eluser]Fuseblown[/eluser]
Try adding a ? after index.php in the RewriteRule as such:

Code:
RewriteRule ^(.*)$ index.php?/$1 [L]

I had the same problem and that worked for me. Took me a while digging through the forums to find the solution.
#4

[eluser]portgaz[/eluser]
Hi try this:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ ci_test/index.php/$1 [L]
Hope that helps!
#5

[eluser]Josh Holloway[/eluser]
Stick the below in your .htaccess file and stick the file in the ci_test folder.

Code:
<IfModule mod_rewrite.c>

    RewriteEngine On
    
    #The base folder (where index.php is found)
    RewriteBase /ci_test/

    #Removes access to the system folder by users.
    
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    #When application folder isn't in the system folder
    #Prevents user access to the application folder
    
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #Checks to see if attempting to access a valid file
    #if this isn't true it sends the request to index.php
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    
</IfModule>

I have the following setup:

-application1
--application
--.htaccess
--index.php

-application2
--application
--.htaccess
--index.php
|system

and it works fine.

I'd suggest you go with the following:

-ci_test
--application
--system
--.htaccess
--index.php
#6

[eluser]4waymedia[/eluser]
Thanks for the feedback. . . I am getting a 404 Page Not found Error now. Soo very frustrating!
#7

[eluser]Josh Holloway[/eluser]
@4waymedia

what suggestion are you using as it will go some way to diagnosing.
#8

[eluser]4waymedia[/eluser]
IT WORKS NOW!! I needed to change the uri_protocal back to Auto.

Thank you. I am Using:

Code:
<IfModule mod_rewrite.c>

    RewriteEngine On
    
    #The base folder (where index.php is found)
    RewriteBase /ci_test/

    #Removes access to the system folder by users.
    
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    #When application folder isn't in the system folder
    #Prevents user access to the application folder
    
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php/$1 [L]

    #Checks to see if attempting to access a valid file
    #if this isn't true it sends the request to index.php
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
    
</IfModule>

I changed the following in the config file:
Code:
$config['uri_protocol'] = "AUTO";

I completely do NOT understand HTACCESS conditions....I guess I have some homework. Thank you for everyones assistance!! I feel like I can now live a normal life again. . . phew!
#9

[eluser]Josh Holloway[/eluser]
Glad we could help.

sorry, missed the AUTO setting in your original post.

Also, http://www.javascriptkit.com/howto/htaccess.shtml - remember - Google is your friend Smile




Theme © iAndrew 2016 - Forum software by © MyBB