簡體   English   中英

Windows托管中的雜貨雜貨

[英]Grocery crud in windows hosting

我在服務器上安裝了Codeigniter,並在其上安裝了Grocery crud。 不幸的是,服務器是基於Windows的,並且不支持url重寫,因此我無法使用Grocery crud。

當我在雜貨店論壇上搜索並一無所獲時,有人可以解釋這個問題的解決方案。

問候

在您的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>

上面是此處 Codeigniter論壇上使用的示例。

您可能還需要確保將$config['uri_protocol']設置為AUTO

在CodeIgniter中更改配置文件,並更改$ config ['querystring'] = false

現在,您可以訪問像這樣的GroceryCrud庫函數:www.example.com/index.php/ControllerClass/FunctionName

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM