Reputation: 562
When I type the URL as www.example.com
, it throws the following error message.
404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
but when I type the URL as www.example.com/index.cfm
, it works. Please advise what can be the problem and how can I solve this issue.
When I open the URL www.example.com
from the server, it throws different error message.
HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.
Upvotes: 1
Views: 319
Reputation: 1074
TechNet has an article on this, what you want to do is add a default document. By default IIS doesn't look for .cfm
files as "default" files like index.html
, so you have to configure it to do that.
From TechNet:
To add a file name to the list of default documents, use the following syntax:
appcmd set config /section:defaultDocument /+files.[value=' string ']
The variable string is the file name that you want to add to the list. For example, to add a file named home.html to the default document list, type the following at the command prompt, and then press ENTER:
appcmd set config /section:defaultDocument /+files.[value=' home.html ']
To remove a file named home.html from the default document list, type the following at the command prompt, and then press ENTER:
appcmd set config /section:defaultDocument /-files.[value=' home.html ']
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).
Upvotes: 6