CodeIgniter Forums

Full Version: htaccess issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]RandyCram[/eluser]
Alright so this is my first time using CodeIgniter. I successfully installed it and i am now reading the general topics section.

I am on the URL section and I am working on removing the index.php file however whenever i create the .htaccess i get an internal server error.

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

any idea what might be causing this?

Thanks in advance :coolhmm:

El Forum

[eluser]Aken[/eluser]
That's a really cheap HTACCESS solution. Try this instead:

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

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

Just make sure to change the "RewriteBase" directory to the folder your install is in. If it's a root directory (AKA at example.com, not example.com/blog), just leave a single slash.