Feature: Robots URL Rules
@GeekInTheNorth ci sta già lavorando.
Dal 26/6/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 3
- Fork
- 5
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GeekInTheNorth/Stott.Optimizely.RobotsHandler
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Cosmetic enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di GeekInTheNorth/Stott.Optimizely.RobotsHandler
Issue simili
-
effort:S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
nightscout/nocturne#4930 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
reactiveui/ReactiveUI#4589 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 91/100
reactiveui/Akavache#1278 ·
I maintainer di solito rispondono entro 1 giorno
-
FOODPLANNER Subtask
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
aau-giraf/foodplanner-api#314 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
juandresrodca/AdminForge#70 ·
I maintainer di solito rispondono entro 1 giorno