FW/1 SES和IIS重写

FW/1 SES和IIS重写,iis,coldfusion,url-rewriting,fw1,Iis,Coldfusion,Url Rewriting,Fw1,我刚刚开始使用FW/1,我只是想让它正常工作,但在SES URL方面运气不太好 因此,在Application.cfc中,我打开SES URL并删除index.cfm我有: generateSES = true SESOmitIndex = true 在mymain.cfc中,我有两项default和seconditem: public void function default( rc ) { rc.when = now(); variables.fw.service( 'f

我刚刚开始使用FW/1,我只是想让它正常工作,但在SES URL方面运气不太好

因此,在
Application.cfc
中,我打开SES URL并删除
index.cfm
我有:

generateSES = true
SESOmitIndex = true
在my
main.cfc
中,我有两项
default
seconditem

public void function default( rc ) {
    rc.when = now();
    variables.fw.service( 'formatter.longdate', 'today' );
}

public void function seconditem( rc ) {
    rc.when = now();
    variables.fw.service( 'formatter.longdate', 'today' );
}
我在
main.cfc
中有每个项目的视图,我在
web.config
文件中有这个重写规则

<rule name="Insert index.cfm" stopProcessing="true">
    <match url="^(.*)$" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="index.cfm/{PATH_INFO}" appendQueryString="true" logRewrittenUrl="true" />
</rule>
因此,根据IIS日志告诉我重写正在工作,为什么当我转到没有
index.cfm
的url时,它总是转到
main.default

我还尝试使用不同的控制器,其中:

http://dev.dev/users/default
-转到
main。默认值

但是:

http://dev.dev/index.cfm/users/default
-转到
用户。默认值

IIS日志显示了这两个请求的情况:

2014-02-19 23:20:47 GET /index.cfm/users - 80
2014-02-19 23:21:37 GET /index.cfm/users - 80

任何想法都将受到赞赏

这里是我在FW/1项目中使用的重写规则

<rule name="Imported Rule 1" stopProcessing="true">
        <match url="^(.*)$" />
        <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" pattern="^((?!\.).)*$|(\.cfm)$" />
            <add input="{URL}" matchType="Pattern" pattern="/(assets|scratch|remote|index.cfm|extensions)" ignoreCase="true" negate="true" />
        </conditions>
        <action type="Rewrite" url="/index.cfm/{R:1}" />
</rule>


第二个
块用于列出我不想重写的目录或文件。

嗨,斯科特,不幸的是,这似乎对我不起作用。当转到除<代码>以外的任何内容时,我只得到一个404 Not Found错误http://dev.dev/。那就转到
http://dev.dev/main/default
http://dev.dev/main/seconditem
两者都会抛出404。我在您的规则中添加了
logrewritenurl=“true”
,IIS日志显示
GET/main/seconditem-80
,因此它根本没有添加
/index.cfm/
。好的,我已经弄清楚发生了什么,只花了2天时间:)在安装上次更新后,我没有重新运行ColdFusion Web服务器配置工具。所以我做到了,现在一切都正常了。谢谢你发布你重写规则。
<rule name="Imported Rule 1" stopProcessing="true">
        <match url="^(.*)$" />
        <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" pattern="^((?!\.).)*$|(\.cfm)$" />
            <add input="{URL}" matchType="Pattern" pattern="/(assets|scratch|remote|index.cfm|extensions)" ignoreCase="true" negate="true" />
        </conditions>
        <action type="Rewrite" url="/index.cfm/{R:1}" />
</rule>