Convert Codeigniter .htaccess file to equivallent web.config file for IIS 8


I have locally developed project using codeigniter framework and Xampp apache server, url redirection is on and rewrite rules are defined in .htaccess file and working properly, here is my .htaccess file:

RewriteEngine On
RewriteBase /myproject
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

now suddenly client requirement has changed and he wants all windows environment, instead of apache he suggested to use IIS, so i have to move to IIS. Same project with little modifications is running and redirecting default controller which is defined in routes.php file but my other redirections are not working. I searched and found that .htaccess file does not work on IIS need to convert .htaccess file to web.config however i tried to convert my .htaccess to web.config as follows :

<?xml version="1.0" encoding="UTF-8"?>
            <rule name="MyRule">
                <match url="^(.*)$" /> 
                         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
                         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />

But this does work,giving following error:

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:

Module IIS Web Core

Notification BeginRequest

Handler Not yet determined

Error Code 0x8007000d

Config Error

Config File \?\C:\inetpub\wwwroot\myproject\web.config Requested URL http://localhost:80/myproject/ Physical Path C:\inetpub\wwwroot\myproject\ Logon Method Not yet determined Logon User Not yet determined

Config Source: -1: 0:

I tried in different ways with different code but it is **showing same error every time,**please help

asked on Stack Overflow Sep 11, 2015 by Amol • edited Sep 11, 2015 by Niranjan N Raju

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0