Feature: Robots URL Rules
@GeekInTheNorth がすでに取り組んでいます。
2026年6月26日 から。
評価
この issue はまだ評価されていません。
説明
Feature: Robots URL Rules
Background
As a website owner, I want to configure rules that are triggered by the presence of specific query string parameters or by partial URL match so that I can alter search engine behaviour for URL variants without requiring a code deployment.
Many websites expose multiple variations of the same page through query string parameters. Whilst these URLs may be useful to visitors, they are often undesirable for search engine indexing as they can result in duplicate content and unnecessary crawl budget consumption.
Users of the External Reviews Addon can generate an external review link for an unpublished version of a page. This URL is generated as https://www.example.com/externalcontentview/<guid> where is a randomly generated GUID. If that page version is part of a Project, then all links on that page are automatically appended with /externalcontentview/<guid>/preview_generated=true. If a content editor accidentally cuts and pastes such a link into their published content, search engine crawlers will then index all those content pages with their obfuscated URLs which is undesirable for SEO. This is a perfect example of where you want to override the robots meta tag and header to prevent indexing of those pages.
Examples include:
/listing-page/?category=123&page=1
/listing-page/?preview=true
/listing-page/?print=true
/listing-page/?sort=name
/listing-page/?view=grid
/externalcontentview/<guid>
/en/some-page/externalContentView?preview_generated=true
whereas URLs such as:
/listing-page/?page=1
may still be considered valid for indexing.
Rather than requiring developers to implement custom logic, administrators should be able to configure query string rules within Stott Robots Handler.
User Story
As a CMS Administrator
I want to configure Query String and URL Rules that execute configurable actions when specific query string parameters are present or URL matches exist
So that I can control how search engines interact with specific URL variants without requiring an application deployment.
Acceptance Criteria
Scenario 1 - Matching Query String
Given a query string rule is enabled
And the request contains a configured query string parameter
When the page is requested
Then the configured actions are executed.
Scenario 2 - No Matching Query String
Given a query string rule is enabled
And the request does not contain a configured query string parameter
When the page is requested
Then no actions are executed
And existing Robots Handler behaviour remains unchanged.
Scenario 3 - URL Matches
Given a URL match rule is enabled
And the request URL matches the defined rule
When the page is requested
Then the configured actions are executed.
Scenario 4 - No URL Matches
Given a URL match rule is enabled
And the request URL does not match any rules
When the page is requested
Then no actions are executed
And existing Robots Handler behaviour remains unchanged.
Scenario 5 - Rules Disabled
Given Robots URL Rules are disabled
When any page is requested
Then existing Robots Handler behaviour remains unchanged.
Scenario 6 - Robots Override Action
Given a Rule contains the Override Robots action
When the request matches the rule
Then the configured robots directives are applied to the Robots meta tag
And the configured robots directives are applied to the X-Robots-Tag response header.
Scenario 7 - Link Processing Action
Given a Rule contains the Add rel="nofollow" to qualifying links action
And an <a> element is rendered
And the destination URL contains a configured query string parameter
Then the rendered link contains a rel="nofollow" attribute.
Example Rules
| Parameter | Value | Directive |
|---|---|---|
| page | * | noindex,follow |
| preview | * | noindex,nofollow |
| true | noindex,follow | |
| search | * | noindex,follow |
Configuration
Add a new administration screen named Robots URL Rules.
Global Settings
- Enable / Disable Robots URL Rules
Rules
Administrators can:
- Create rules
- Edit rules
- Delete rules
- Enable / Disable rules
- Reorder rule priority
Each rule contains:
General
- Name
- Enabled
Matching
- One Query String Parameter Name
- Parameter names only (no '=' or values)
- Validation to ensure valid parameter names
- At least one parameter is required
- One URL Match
Actions
A rule can execute one or more actions.
Override Robots
When enabled:
- Override the Robots meta tag
- Override the
X-Robots-Tagresponse header
Administrators can configure:
- No Index
- No Follow
Add rel="nofollow" to Qualifying Links
When enabled:
- Any generated
<a>element whose destination contains a matching query string parameter will automatically receive anofollowrelationship.
Processing Order
The existing robots override pipeline becomes:
- Robots URL Rules
- Environment Robots Override
- Page-specific Robots configuration
- Default behaviour
This ensures rules can be tested in lower environments when environmental locks are in place.
Implementation Notes
Storage
- Store configuration in DDS.
- Continue to use the existing Repository / Service pattern.
- Cache configuration to minimise DDS lookups.
MetaRobotsTagHelper
Existing:
- If an Environment Robots Override exists, return the configured environment directives.
New:
- If a matching Query String Rule contains the Override Robots action, return the configured robots directives.
Existing:
- If no robots directives are configured, remove the meta tag.
RobotsHeaderMiddleware
Existing:
- If an Environment Robots Override exists, return the configured
X-Robots-Tag.
New:
- If a matching Query String Rule contains the Override Robots action, return the configured
X-Robots-Tag.
Link Processing
When rendering links:
-
Detect whether the destination URL contains a configured query string parameter.
-
If a matching Query String Rule contains the Add
rel="nofollow"action:- Add
nofollowto therelattribute. - Preserve any existing
relvalues. - Do not add duplicate values.
- Add
Version 1 Scope
The initial release supports matching on:
- Presence of one or more query string parameter names.
Future enhancements may include:
- Parameter value matching
- Wildcard parameter names (e.g.
utm_*) - Regular expression matching
- Additional actions beyond robots handling
The underlying design should therefore separate matching from actions, allowing new actions to be introduced without redesigning the feature.
- 主要言語
- C#
- スター
- 3
- フォーク
- 5
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
GeekInTheNorth/Stott.Optimizely.RobotsHandler のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
Cosmetic enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
GeekInTheNorth/Stott.Optimizely.RobotsHandler の issue をすべて見る
似ている issue
-
effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
nightscout/nocturne#4930 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
reactiveui/ReactiveUI#4589 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
reactiveui/Akavache#1278 ·
メンテナーはふだん 1 日以内に返信
-
FOODPLANNER Subtask
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
aau-giraf/foodplanner-api#314 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
juandresrodca/AdminForge#70 ·
メンテナーはふだん 1 日以内に返信