Welcome Guest, Not a member yet? Register   Sign In
Problems removing index.php from URLs :(
#1

[eluser]K-Fella[/eluser]
I just can't seem to remove the index.php from URLs Sad

I've tried all of the .htaccess files suggested here on the forums.

I've checked the server and mod_rewrite is enabled. AllowOverride is set to ALL. The version of Apache is 2.0.52.

It works perfectly fine on my localhost using this .htaccess:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Some things probably worth mentioning:

1. I have added some custom routes - although pages that don't use these routes don't work either.
2. I have moved the application folder out of the system folder.

Any ideas?
#2

[eluser]luke-f[/eluser]
Here's what I'm using:

Code:
RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index\.php|image|library|style|script|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

I took it from Derek's blog (post link)

It work fine for me.
#3

[eluser]K-Fella[/eluser]
That one didn't work either Sad

In fact, that didn't even work on my localhost.
#4

[eluser]alexsancho[/eluser]
can you explain more about your setup?, directory tree, apache config if available, with more info maybe anyone finds the clue Wink
#5

[eluser]luke-f[/eluser]
I would try some basic mod_rewrite outside your codeigniter application. You would see if there's something wrong with the way you use codeigniter or if it's your mod_rewrite configuration.
#6

[eluser]K-Fella[/eluser]
Folder tree:
-public_html
-- application
-- images
-- css
-- system

Can't post Apache config, don't have access.

The homepage works fine. It's only if I try visiting /news, /press, etc. Basically any deeper links.

Config line:
Code:
$config['index_page'] = "";
I'm not sure what else to include :question:
The website is www.inch.ie, btw.
#7

[eluser]Unknown[/eluser]
I had the same problem, it took the addition of one more slash to the .htaccess file, mine reads:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
#8

[eluser]K-Fella[/eluser]
Made no difference Sad
#9

[eluser]esra[/eluser]
Moving application/ out of system/ should be fine if you have your paths set correctly in the boostrap loader (index.php). I'm using the following with the uri protocol set to AUTO:

Code:
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]




Theme © iAndrew 2016 - Forum software by © MyBB