.htaccess file causing forbidden error in my codeigniter application, I am running apache 24 in my windows server

  .htaccess, apache, codeigniter, windows

Without the .htaccess file the application running perfectly,
Whenever I add .htaccess file it showing forbidden don’t have access to the / server.
I tried to put “Test.” in the first line of .htaccess file it “showing Internal server error” that’s good apache reading .htaccess file.
But whenever it read “RewriteEngine on” line in .htaccess file immediately it showing forbidden error.

here is my .htaccess file.

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

And httpd.config file

   DocumentRoot "${SRVROOT}/htdocs"
   <Directory "${SRVROOT}/htdocs">
   #
   # Possible values for the Options directive are "None", "All",
   # or any combination of:
   #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
   #
   # Note that "MultiViews" must be named *explicitly* --- "Options All"
   # doesn't give it to you.
   #
   # The Options directive is both complicated and important.  Please see
   # http://httpd.apache.org/docs/2.4/mod/core.html#options
   # for more information.
   #
   Options Indexes FollowSymLinks

   #
   # AllowOverride controls what directives may be placed in .htaccess files.
   # It can be "All", "None", or any combination of the keywords:
   #   AllowOverride FileInfo AuthConfig Limit
   #
   AllowOverride All

   #
   # Controls who can get stuff from this server.
   #
   Require all granted
   Options ExecCGI 
   </Directory>

Source: StackOverflow

LEAVE A COMMENT