我有以下规则IIS重写规则不起作用
<rule name="SEO" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_USER_AGENT}" pattern="(facebookexternalhit)|(facebook)|(Twitterbot)|(Pinterest)" />
<add input="{QUERY_STRING}" pattern=".*escaped_fragment_=(.*)" />
</conditions>
<action type="Rewrite" url="http://localhost:8004/{URL}" />
</rule>
我angularJS主办的IIS(Windows Server 2012中)上应用的
。
我的应用程序使用html5Mode
$locationProvider.html5Mode().enabled = true;
和8004
被打开的端口(I关闭Windows防火墙一会儿,以检查是否我的方案作品)
的scenrio容易。当有人想通过facebook
分享我AngularJS
页面,请求将被重定向到的端口,whene的PhantomJS
上(渲染页面)
倾听着,但问题是我只能看到404错误的份额箱,并没有请求由phantomJS脚本读取(我没有看到在控制台窗口中的任何东西)
var system = require('system');
var server = require('webserver').create();
server.listen(port, function (request, response) {
console.log(JSON.stringify(request, null, 4));
});
所以它看起来像重写规则不起作用(这是我的猜测)。如果我只是去http://localhost:8004/
,我可以在控制台窗口中看到渲染的页面和幻影日志(所以它的工作原理)
你使用FB调试工具清除缓存? – CBroe