Skip to content

Commit 076f50d

Browse files
author
Rick Anderson
authored
explain ~ (dotnet#9121)
* explain ~ * Minor tweaks * Minor tweak * react to feedback * Update index.md * Update static-files.md * react to feedback
1 parent 369a25b commit 076f50d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

aspnetcore/fundamentals/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ For more information, see <xref:fundamentals/startup>.
6969

7070
The content root is the base path to any content used by the app, such as [Razor Pages](xref:razor-pages/index), MVC views, and static assets. By default, the content root is the same location as the app base path for the executable hosting the app.
7171

72-
## Web root
72+
## Web root (webroot)
7373

74-
The web root of an app is the directory in the project containing public, static resources, such as CSS, JavaScript, and image files.
74+
The webroot of an app is the directory in the project containing public, static resources, such as CSS, JavaScript, and image files. By default, *wwwroot* is the webroot.
75+
76+
For Razor (*.cshtml*) files, the tilde-slash `~/` points to the webroot. Paths beginning with `~/` are referred to as virtual paths.
7577

7678
## Dependency injection (services)
7779

aspnetcore/fundamentals/static-files.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: rick-anderson
44
description: Learn how to serve and secure static files and configure static file hosting middleware behaviors in an ASP.NET Core web app.
55
ms.author: riande
66
ms.custom: mvc
7-
ms.date: 01/18/2018
7+
ms.date: 10/18/2018
88
uid: fundamentals/static-files
99
---
1010
# Static files in ASP.NET Core
@@ -66,6 +66,8 @@ The parameterless `UseStaticFiles` method overload marks the files in web root a
6666

6767
[!code-cshtml[](static-files/samples/1x/Views/Home/Index.cshtml?name=snippet_static_file_wwwroot)]
6868

69+
In the preceding code, the tilde character `~/` points to webroot. For more information, see [Web root](xref:fundamentals/index#web-root).
70+
6971
### Serve files outside of web root
7072

7173
Consider a directory hierarchy in which the static files to be served reside outside of the web root:

0 commit comments

Comments
 (0)