Codeigniter应用程序的Web Config文件 [英] Web Config file for a codeigniter application

查看:62
本文介绍了Codeigniter应用程序的Web Config文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个Web配置文件,该文件未为我的codeigniter应用程序重写URL.这是Web配置文件.

I am suffering with a web config file that is not rewrite the url for my codeigniter application. here is the 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="true" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>

这是我的网站: http://gandhitomodi.com

我无法获得此类网址 http://gandhitomodi.com/controller/method/

例如

http://gandhitomodi.com/welcome/index/

请帮助我解决这个问题.

Please Help me through this.

****已编辑*****

****Edited*****

这是route.php

here is the route.php

$route['default_controller']="welcome/index";
$route['sendmail']="welcome/send";

这是我已更改的config.php设置.

here is the config.php settings that i have changed.

$config['base_url']="http://gandhitomodi.com/";
$config['index_page']='';
$config['url_protocal']='PATH_INFO';`

推荐答案

您是否尝试过此处提到的此方法

Have you tries this method as mention here

也在这里提到

https://博客.msdn.microsoft.com/azureossds/2015/09/28/convert-apache-htaccess-to-iis-web-config/

在"URL重写"部分下.它与我使用的.htaccess相同,也有许多在线转换器可供您尝试

under the URL Rewriting section. It has the same .htaccess which I am using also there are many online converters to whom you can give a try

这篇关于Codeigniter应用程序的Web Config文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆