Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove index.php in codeigniter on Windows Server and IIS?

How to remove index.php in codeigniter on Windows Server and IIS?

I found this when i search for answer

How to rewrite the index.php of Codeigniter on Windows Azure

but when i try my CI still need index.php to run whre the web.config file must be add and is there any other step before i edit my web.config?

like image 943
ian Avatar asked Aug 22 '14 03:08

ian


Video Answer


1 Answers

If URL Rewrite module is not installed, please install it from here http://www.iis.net/downloads/microsoft/url-rewrite

Please check the complete web.config file. Place this in the same folder where the index.php is placed.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
          </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

Its working in IIS in Windows server 2008 R2

like image 65
Mansoorkhan Cherupuzha Avatar answered Oct 18 '22 15:10

Mansoorkhan Cherupuzha