0

I have setup Codeigniter on my server and I installed Grocery crud on it. Unfortunately server is windows based and does not support url rewriting and I am stuck using Grocery crud with it.

Can someone explain the solution to this, as I searched grocery crud forum and found nothing.

Regards

Murtaza Khursheed Hussain
  • 15,176
  • 7
  • 58
  • 83

2 Answers2

0

Create a file named web.config in your web root and place the following into the file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rewrite to index.php">
                    <match url="index.php|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>
    </system.webServer>
</configuration>

The above is the example used on the Codeigniter Forums here.

You may also need to ensure that $config['uri_protocol'] is set to AUTO

Ben Swinburne
  • 25,669
  • 10
  • 69
  • 108
  • while I never use the above config but I implement a default solution which will work on any hosting service which is change your CI config file and change the querystring parameter to false. now you can access the grocery crud lib as www.example.com/index.php/ClassName/functionName – Murtaza Khursheed Hussain Jun 27 '12 at 15:19
  • Ah fair enough. You should either accept an answer or post your own and accept it so this question stops appearing in unanswered lists. – Ben Swinburne Jun 27 '12 at 15:46
0

Change config file in CodeIgniter and change $config['querystring'] = false

Now you can access GroceryCrud library functions like this www.example.com/index.php/ControllerClass/FunctionName

Ben Swinburne
  • 25,669
  • 10
  • 69
  • 108
Murtaza Khursheed Hussain
  • 15,176
  • 7
  • 58
  • 83