Skip to content

Add Easy Rule Name URLs#3660

Merged
TomasVotruba merged 10 commits intorectorphp:mainfrom
JHWelch:easy-rule-urls
May 6, 2026
Merged

Add Easy Rule Name URLs#3660
TomasVotruba merged 10 commits intorectorphp:mainfrom
JHWelch:easy-rule-urls

Conversation

@JHWelch
Copy link
Copy Markdown
Contributor

@JHWelch JHWelch commented Apr 8, 2026

This PR does two related things.

First it allows you to use the PascalCase class name of a rule to find it via the URL. To maintain one consistent canonical URL, this will still redirect to the slug that it is currently. So:
/rule-detail/ArrayToFirstClassCallableRector will 301 redirect to
/rule-detail/array-to-first-class-callable-rector

The second thing this adds is an extra convenient way to find rules, which is resolving them via slug or class name at the root of the URL.

This process also redirects to the /rule-detail/kebab-slug for a canonical URL, but allows for quickly finding a rector rule from name.

So this same rule would be accessible at
https://getrector.com/ArrayToFirstClassCallableRector
and it would redirect to
/rule-detail/array-to-first-class-callable-rector

If you would like either part of this separately without the other I can split this apart, just let me know.

Thanks!

@TomasVotruba TomasVotruba merged commit e3c32dd into rectorphp:main May 6, 2026
8 checks passed
@TomasVotruba
Copy link
Copy Markdown
Member

Looks good, I wanted this feature for such a long time. Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants