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

1

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"?>
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="MyRule">
                <match url="^(.*)$" /> 
                    <conditions> 
                         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
                         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
                    </conditions> 
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
             </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration> 

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

php
apache
.htaccess
mod-rewrite
iis
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