从Godldy Plesk托管中的​​codeigniter中删除url代码中的index.php是不行的?

Sha*_*alu 3 codeigniter

我试过以下代码.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

我在配置文件index_page中替换为空白,但仍然无法正常工作并出现此错误.

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.

Sha*_*alu 7

我已经解决了这个问题.我在codeigniter的根目录下创建了web.config.我的守则如下.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^(.*)$" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite> 
    </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

它对我有用.我希望这也能帮助别人.