Does codeigniter redirect not work without index.php?

I am new to codeigniter, and index.php page redirection does not load by default. So I tried the code below in the htaccess file. I installed php 5.3.10, Apache server and postgres database. therefore, if any new configuration needs to be done separately from the .htaccess and httpd.conf changes, then please let me know. I saw previous questions asked on the same question, and I sent everything from these questions, but still I can not solve it. please let me know what else needs to be done.

.htaccess

 <IfModule mod_rewrite.c> RewriteEngine On #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|public|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
    RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^/(index\.php|assets/|humans\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L] 

file httpd.conf   server_name localhost

<Directory />
   Options FollowSymLinks
   AllowOverride All
   Order deny,allow
   Deny from all
</Directory>
+4
2

, , index.php url

  • , .htaccess. .

  • .htaccess, @charlie .

  • httpd.conf nano , allowoveride All

  • , apache2, .

    sudo a2dismod rewrite//

    sudo a2enmod rewrite//

    sudo service apache2 restart//, apache

, . .

+2

.htaccess

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

All Articles