Skip to content

Commit c666b61

Browse files
wadepickettCopilottdykstra
authored
Update copilot-instructions.md: Handling File Redirection (#35955)
* Update copilot-instructions.md: Handling File Redirection Copilot needed to be aware of how to handle file redirection, so it actively takes care of it when assigned an issue. * Update .github/copilot-instructions.md Co-authored-by: Copilot <[email protected]> * Apply suggestions from code review Adding Tdykstra's great suggestions. Co-authored-by: Tom Dykstra <[email protected]> * Update copilot-instructions.md --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Tom Dykstra <[email protected]>
1 parent d06cae2 commit c666b61

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

.github/copilot-instructions.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
author: wadepickett
33
ms.author: wpickett
4-
ms.date: 07-31-2025
4+
ms.date: 08-17-2025
55
---
66

77
# Copilot Instructions for `dotnet/AspNetCore.Docs`
@@ -62,6 +62,29 @@ When creating a PR for an issue:
6262
- Open Lower Bound: `<= aspnetcore-9.0`
6363
- Specific Version: `== aspnetcore-9.0`
6464

65+
### Handling File Redirections
66+
- When a Markdown (.md) article file (this does not apply to includes) is deleted in a PR, create a redirection entry.
67+
- Redirections ensure users following existing links aren't left with broken links
68+
- To add a redirection:
69+
1. Update the `.openpublishing.redirection.json` file at the repository root
70+
2. Follow this format for new entries:
71+
```json
72+
{
73+
"source_path": "aspnetcore/path/to/deleted-file.md",
74+
"redirect_url": "/aspnet/core/path/to/target-file",
75+
"redirect_document_id": false
76+
}
77+
```
78+
3. Use relative URLs for redirection to pages in the `learn.microsoft.com` domain
79+
- Example: `/aspnet/core/path/to/target-file`
80+
4. For URLs in a different domain, use absolute URLs including the domain.
81+
- Example: `https://learn.microsoft.com/dotnet/core/introduction`
82+
5. Set `redirect_document_id` to `false` unless specifically instructed otherwise
83+
6. Maintain alphabetical order of the `source_path` entries for better organization
84+
7. Ensure proper JSON formatting with correct commas between entries
85+
- When selecting a redirect target, choose the most relevant existing content that would serve the user's original intent
86+
- If no direct replacement exists, redirect to a parent category page or related topic
87+
6588
### Code Snippets
6689
- For code snippets longer than 6 lines:
6790
1. Create a subfolder named after the document the snippet supports.

0 commit comments

Comments
 (0)