1

I have big problem trying to remove index.php from url's

i have searched lots if forums (this also), but no help for my situation.

so i have config.php file

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

my .htaccess file in public_html folder near index.php.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

i have rewrite_module ON (and it's working) and my httpd.conf AllowOverride set to All

so when i am going to mydomain.com/controller/action - I get 404 but when i go to mydomain.com/index.php/controller/action - everything is OK..

i have tried lots of .htaccess examples... and so on.. nothing helps..

1
  • Issue is resolved as This issue was coming from python.I uninstalled it yesterday.Now it working fine after i installed python on my PC. My Configuration in codeigniter is correct. Thanks 4 help. Commented Aug 5, 2015 at 8:15

2 Answers 2

1

.htaccess (This should be place outside application folder)

Paste this

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

Note : Sometime index.php will not remove in windows. But if you upload it to server it will work fine. This happen me too in XAMPP but if i upload it to host(Linux) it works fine

Sign up to request clarification or add additional context in comments.

5 Comments

This issue is coming after i uninstalled python from my computer.**LoadModule wsgi_module modules/mod_wsgi.so**.I commented this from httpd.conf but still nothings changed.
no worry. If you possible to host that to live server, try once.(Even sub domain)
Actually i am using this setup from a long time but yesterday i uninstalled python.Yes this setup work on centos because i have taken backup from server to work on my local computer.
sir : issue resolved by Installing python again. still i don't know how python is effecting working of wamp server.
Sir This account is not having enough reputation But thanks anyways.
0

My Config which is working fine :

config.php

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

.htaccess

# index file can be index.php, home.php, default.php etc.
DirectoryIndex index.php

# Rewrite engine
RewriteEngine On

# condition with escaping special chars
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

2 Comments

Not working ! The page you requested was not found.
Check if your .htaccess is working, add this : //Rewrite to www Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^google.com[nc] RewriteRule ^(.*)$ http://www.google.com/$1 [r=301,nc]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.