Click here to Skip to main content
15,886,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've setup codeigniter on IIS and everything is working fine except when I try to go to a subfolder. What happens is that it appends to the URL and then codeigniter can't find what it is looking for.

So bacially when I try to go to www.domain.com/subfolder it appends www.domain.com/subfolder/subfolder. Is there a way to fix that with URL rewrite? This is what I have:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Rewrite to index.php">
          <match url="index.php|uploads|resources|robots.txt|images|test.php" />
          <action type="None" />
        </rule>
        <rule name="Rewrite CI Index">
          <match url=".*" />
          <conditions>
            <add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
      </rules>
    </rewrite>
        <directoryBrowse enabled="false" />
  </system.webServer>
</configuration>


Thanks!
Posted
Updated 11-May-20 20:13pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900