[edit]: duplicate of How to remove "index.php" in codeigniter's path
[the solutions there dont work for me]
Im trying out codeigniter for the first time and im pretty new to php still. I wanted to remove the index.php from my url.
installed code igniter
replaced index.php that was there with my own
I have this in my .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
#Removes access to the 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]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
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
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>
My rewrite is definately on, i load a phpinfo page in my root and it shows the module loaded. Ive also checked the httpd.conf
when i run from NetBeans i am directed to localhost:8888/domain/index.php and my index page loads
when i go to localhost:8888/domain then my index.php also loads
when i go to localhost:8888/domain/welcome or localhost:8888/domain/welcome.php i get 404 The requested URL /index.php/welcome was not found on this server.
when i go to localhost:8888/domain/index.php/welcome i get directed to the welcome controller but it just loads my index.php but with no markup.
Ive also tried this in the .htaccess:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
and i get:
This also didnt work (i know, theyre all meant to be doing pretty much the same thing):
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,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>
I have in config/config.php:
$config['base_url'] = 'localhost:8888/domain.com/';
$config['index_page'] = '';