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

[eluser]anna16[/eluser]
Hi guys

I have successfully installed and run CodeIgniter ver. 2.0
http://coder9.com/ci2/index.php

This is my first test,
http://coder9.com/ci2/index.php/site/show_text/

Now i tried to remove the index.php
by modifying the .htaccess using the codes below,
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

But the problem is my main page of my site below
coder9.com is the one showing,

here is below the test page without the index.php
http://coder9.com/ci2/site/show_text/

I hope someone will guide me.

Thanks in advanced.
#2

[eluser]InsiteFX[/eluser]
Hi anna,

Try this one:
Code:
<IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    # NOTICE: If you get a 404 play with combinations of the following commented out lines
    #AllowOverride All
    #RewriteBase /yourbase

        RewriteCond $1 !^(index\.php|images|robots\.txt)

    # Send request via index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    <IfModule mod_php5.c>
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>

    <IfModule !mod_php5.c>
        RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule>

</IfModule>

InsiteFX
#3

[eluser]anna16[/eluser]
WOW! it's magic.
It worked.

@InsiteFX you are an Angel.

Thank you very much.
By the way can you suggest what is the best website for .htaccess tutorial.
#4

[eluser]InsiteFX[/eluser]
Hi anna,

Apache HTTP Server Version 1.3

htaccess Tips and Tricks

InsiteFX
#5

[eluser]anna16[/eluser]
thanks again.




Theme © iAndrew 2016 - Forum software by © MyBB