I have a codeigniter app working fine locally with WAMP. However, I am having trouble getting it to work on an IIS server. Please note that I do not want to enable query strings.
Here is what I currently have in my web.config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Clean URL" stopProcessing="true">
<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>
This causes the main page to load properly: www.website.com/policies
However, when I click on an item to go to: www.website.com/policies/policy/view/31
The proper page is not displayed. The main page continues to be displayed.
The controller is Policy and the function is view(). The Codeigniter files are in a policies/ folder on the server.
I think the problem may be with my web.config file. The Config file's $config['base_url'] is dynamically calculated and is the correct one. The Config file's $config['index_page'] is blank. What do you think is causing this problem?
Thank you all for your help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…