[英]Grocery crud in windows hosting
I have setup Codeigniter on my server and I installed Grocery crud on it. 我在服务器上安装了Codeigniter,并在其上安装了Grocery crud。 Unfortunately server is windows based and does not support url rewriting and I am stuck using Grocery crud with it.
不幸的是,服务器是基于Windows的,并且不支持url重写,因此我无法使用Grocery crud。
Can someone explain the solution to this, as I searched grocery crud forum and found nothing. 当我在杂货店论坛上搜索并一无所获时,有人可以解释这个问题的解决方案。
Regards 问候
Create a file named web.config
in your web root and place the following into the file 在您的Web根目录中创建一个名为
web.config
的文件,并将以下内容放入该文件中
<?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 . 上面是此处 Codeigniter论坛上使用的示例。
You may also need to ensure that $config['uri_protocol']
is set to AUTO
您可能还需要确保将
$config['uri_protocol']
设置为AUTO
Change config file in CodeIgniter and change $config['querystring'] = false 在CodeIgniter中更改配置文件,并更改$ config ['querystring'] = false
Now you can access GroceryCrud library functions like this www.example.com/index.php/ControllerClass/FunctionName 现在,您可以访问像这样的GroceryCrud库函数:www.example.com/index.php/ControllerClass/FunctionName
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.