0

I am trying to activate my SSL for my project but one of the the urls doesn't respond.

This is the web site and when you paste the url to the browser, it downloads the .txt file. http://www.xxx.co.uk/.well-known/pki-validation/83CB00D29E282E1FFD6DFB220F030EF4.txt

This is the Restful .Net Core API domain and when you paste the url to the browser, it returns 404 error. http://api.xxx.co.uk/.well-known/pki-validation/83CB00D29E282E1FFD6DFB220F030EF4.txt

Under the IIS I have compared the psychical paths, permissions and it seems everything is same. I believe something in Rest API blocks the .txt file download. Should I check the web.config or something I need to add to the C# source code? Should I update ConfigureServices(IServiceCollection services)? In IIS I have checked MIME Types and the .txt is already defined.

Any suggestions?

thus
  • 1,326
  • 1
  • 14
  • 23

1 Answers1

1

I believe my problem is pointing to this subject but I am not sure how to enable/define .txt files in startup.cs. Any code snippets?

How to Serve Static File

EDIT: Finally I found a solution. Now the browser can download the .txt files. What I did is, I created a virtual directory in IIS. Here are the steps:

  • Go to the C: drive
  • Create a new folder called well-known
  • Inside the .well-known folder, create another folder named pki-validation
  • so far, your folders should look like this: C:\.well-known\pki-validation
  • Upload the TXT file in the pki-validation folder
  • Open the IIS Manager on your server
  • Do a right click on your website and select Add Virtual Directory
  • In the Alias section write .well-known
  • In the Psychical Path area enter the path to the well known folder. For example: C:\well-known
  • Press OK to create this alias

The urls are now serving the .txt files. I hope these steps one day saves the other developers time.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
thus
  • 1,326
  • 1
  • 14
  • 23