CodeIgniter Forums
removing index.php, funky stuff going on - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: removing index.php, funky stuff going on (/showthread.php?tid=10379)



removing index.php, funky stuff going on - El Forum - 07-29-2008

[eluser]ferno[/eluser]
Ok, so I edited the config file and changed "index.php" to "" and edited my .htacess file to read:

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

but when I run my site, everytime I click on a link (to access a controller) the URL changes appropriately, but the home page is shown everytime.

So my URL is changing correctly, but the actual page is not changing at all.

Any suggestions?


removing index.php, funky stuff going on - El Forum - 07-29-2008

[eluser]InterCoder[/eluser]
Try this (from super .htaccess):
Code:
Options -Indexes
Options +FollowSymLinks
DirectoryIndex index.php

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !index.php
RewriteRule (.*)\.php$ index.php/$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]

# Charset
AddDefaultCharset UTF-8

#Far Future Expires Header
# !! add js|css !!!!
<FilesMatch "\.(gif|png|jpg|swf)$">
    ExpiresActive On
    ExpiresDefault "access plus 10 years"
</FilesMatch>

# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

#Remove ETag
FileETag none