I have a customer who wants their weblink site to be indexed by Google, however when I try to submit the sitemap and request indexing from Google's webmaster tools, I get a "redirect" status and the page fails to load or index. I suspect the error may be with Weblink, however and not the server IIS configuration. After investigating, here is what I know:
- Accessing the site via web browsers with cookies enabled works fine... site responds with 200 OK status. With cookies disabled, the site is still accessible, only the status is 302 Redirected. The page still loads normally, however.
- When accessing the site via "Fetch as Google" from the webmaster tools, it gets redirected with the following response:
HTTP/1.1 302 Found
Content-Type: text/html; charset=utf-8
Location: /WebLink8/Error.aspx?aspxerrorpath=/WebLink8/Browse.aspx
Server: Microsoft-IIS/7.5
X-Powered-By: UrlRewriter.NET 2.0.0
X-Powered-By: ASP.NET
- At the same time as this request errors out, the event viewer has a corresponding error:
Log Name: Application
Source: ASP.NET 2.0.50727.0
Date: 5/18/2015 9:10:32 AM
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Description:
Event code: 3005 Event message: An unhandled exception has occurred.
Event sequence: 374
Event occurrence: 101
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT/WebLink8-1-130764187323979000
Trust level: Full
Application Virtual Path: /WebLink8
Application Path: C:\Program Files (x86)\Laserfiche\WebLink 8\Web Files\
Process information:
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
Request information: Request URL: http://---.---.com/weblink8/browse.aspx
Request path: /weblink8/browse.aspx
User host address: ---.---.---.---
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at WebLinkCommon.Language.SetThreadCulture(HttpRequest request)
at WebLink8.Global.Session_Start(Object sender, EventArgs e)
at System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)
at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
- One more strange thing... I did some testing using wireshark and curl to access the web page. If I request the webpage using the exact same request headers as Google, I get the same response (the redirect to an error page that causes an unhandled exception in weblink). If I simply add the "Accept-Language: en-US" header to that request, it appears to go through just fine. Is there anything I can look into regarding how Weblink handles requests that don't have a preferred language header? I suspect this is the issue given the stack trace from the error log which is getting caught on the SetThreadCulture method.