1

How to remove index.php from windows server Found an answer from this

Tried the following method.

1.Create a file named web.config in my root of codeigniter project.

2.Place the following to it

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

But it didn't work form me.

Shark Lasers
  • 441
  • 6
  • 15
Blessan Kurien
  • 1,645
  • 9
  • 31
  • 63

2 Answers2

0

You can try following steps:

Open the folder “application/config” and open the file “config.php“. find and replace the below code in config.php file.

//find the below code   
$config['index_page'] = "index.php" 
//replace with the below code
$config['index_page'] = ""

Then find the if you have the code $config['uri_protocol'] = "AUTO" change to $config['uri_protocol'] = "REQUEST_URI"

You content of web.config should be fine, and when you modify the file, you need to restart the Azure Web Apps Server.

Gary Liu
  • 13,758
  • 1
  • 17
  • 32
0

Removing index.php from the url is something that must be done with htaccess, go to the root of your application and create a new file called ".htaccess" and input the following:

 Options +FollowSymLinks
 RewriteEngine On

 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ index.php [L]
killstreet
  • 1,251
  • 2
  • 15
  • 37