我有以下規則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