【发布时间】:2014-10-15 19:18:57
【问题描述】:
所以我有一台新笔记本电脑,并将我所有的东西都从旧笔记本电脑上移过来。遇到了几个问题,但除了 URL 重写之外,我能够克服它们。我使用的是 Windows 7 pro 64 位、Adobe ColdFusion 10 update 13、FW/1 2.2 和 IIS 7,带有 URL Rewrite。这一切都在旧笔记本电脑上运行良好,一个显着的区别是 Adobe ColdFusion 9。
网站不在根目录,是一个子文件夹“CCC”。
这是我的 web.config。
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="FW/1 URL Rewriting" enabled="true">
<match url="^(.*)$" ignoreCase="true" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/ccc/index.cfm/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
也试过这个:
<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="/ccc/index.cfm/{R:1}" appendQueryString="true" />
</rule>
还有这个
<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="/ccc/index.cfm/{PATH_INFO}" appendQueryString="true" logRewrittenUrl="true" />
</rule>
目前,无论我单击哪个链接,它都会将我带到默认的主页面。以下是一些示例链接。
- dev/ccc/project/dashbord/
- dev/ccc/project/id/15
- dev/ccc/contact/
如果我将 index.cfm 添加到上面的链接中,它可以正常工作。
- dev/ccc/index.cfm/project/dashbord/
- dev/ccc/index.cfm/project/id/15
- dev/ccc/index.cfm/contact/
对于 Windows 7 Pro 64 位、IIS、ColdFusion(双倍)或 FW/1(双倍)我可能错过了任何其他设置吗? 非常感谢任何建议。
【问题讨论】:
-
您是否尝试过再次运行 ColdFusion Web 连接器?
-
还可以查看 FW/1 wiki 上关于 SES URL 的讨论 - github.com/framework-one/fw1/wiki/Helpful-Links#url-rewrites
-
感谢您的回复,我将按照 Brad Wood 下面提供的说明进行尝试。感谢 FW/1 引用链接。
-
卸载并重新安装 ColdFusion IIS 连接器,再次感谢您的回复。
标签: iis-7 coldfusion url-rewriting coldfusion-10 fw1