I am facing this issue on linux and windows both.
I've a simple web application template with only one html page named index.html I've deployed it to linux and windows hosting.
Similarly, I've created a facebook page and I posted a link of my website.
When I click on link facebook opens up a new window and it's like wwww.foo.com/?fbclid=XXXXXXXXXXXX and web page does not load rather ERR_CONNECTION_RESET appears.
I've tried few solutions but nothing worked.
Linux Ubuntu
I checked the ningx access.log and when I click on outbound Url in facebook and it comes to my web pages following line appears in nginx access.log
[21/Jul/2020:13:10:05 +0500] "HTTP/1.0 302 Moved Temporarily" 400 182 "-" "-"
I've tried following block but it does nothing.
location / {
error_page 302 =301 http://example.com/notfound.html;
}
When an outbound link open up a web page its URL is like:
foo.com/index.html?fbclid=IwAR1RoE_FBHre-gTMc3IzkycdYHskuUBlVi4HfKQjuiBN0N4uryxWrKAcDpo
It appears with ERR_CONNECTION_RESET. If I will refresh the page manually it will show page but not from facebook post URL.
Window Server
Solution#1
In Web.config I've tried rule which is as follow:
<system.webServer>
<rewrite>
<rules>
<rule name="SpecificRedirectFBClid" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^fbclid=" />
</conditions>
<action type="Redirect" url="foo.com/{R:0}" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
Solution#2
I've also tried adding
<link rel="canonical" href="foo.com">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="CACHE">
My end goal is to load website. It does not matter either fbclid appears in query parameter or not.
When I click on my website link in facebook post it opens up it in a new window with error. But when I refresh page in the same window it load smoothly.
I've read multiple forums and blogs but could not get anything for ASP.NET Web application.
FINAL SOLUTION
I got the solution. My application was running on http and once I changed http to https everything started working. I think at my server I had SSL certificate which was not configured. I am not sure what was the cause. But once I changed http to https everything worked as expected.