I am using snow leopard and I have my local environment and I am trying to get rid of the index.php in the url...here is what i have
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
My config file has this
$config['index_page'] = "";
But when i visit the page without index.php it doesnt work
this works
http://localhost/ci_example/index.php/site
this doesnt
http://localhost/ci_example/site
I tried to follow this
maybe i need to do something with my local conf file...but i really dont know what and i have no idea how to restart apache command line...any ideas
Try to add RewriteBase in the .htaccess file
What do you mean when you say "it doesn't work"? Do you get an error? A white screen? A 500 error?
Did you make sure your httpd.conf file has the
AllowOverride
setting set toAll
? If not, it may not be using your .htaccess file, meaning the rewrite rules won't be used.Here is something that works for me on OS X.
The above should work for you without any modification. If you're hosting in a folder lets say like http://myserver.com/my_app/ then change /index.php to /my_app/index.php in both places.
Be sure to go into config.php and change url_protocol to PATH_INFO.
Copy this into your .htaccess
Try this .htaccess code & change the base path , it will work for all godaddy and other hostnigs.
Options
Options -Multiviews Options +FollowSymLinks
Enable mod rewrite
RewriteEngine On
the location of the root of your site
if writing for subdirectories, you would enter /subdirectory
RewriteBase /winscore
Removes access to CodeIgniter system folder by users.
Additionally this will allow you to create a System.php controller,
previously this would not have been possible.
'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php?/$1 [L]
Checks to see if the user is attempting to access a valid file,
such as an image or css document, if this isn't true it sends the
request to index.php
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
This last condition enables access to the images and css
folders, and the robots.txt file
RewriteCond $1 !^(index.php|images|robots.txt|css)
RewriteRule ^(.*)$ index.php?/$1 [L]