Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The correct way to match a user agent? #3965

Open
dtw opened this issue Jan 2, 2025 · 0 comments
Open

The correct way to match a user agent? #3965

dtw opened this issue Jan 2, 2025 · 0 comments

Comments

@dtw
Copy link

dtw commented Jan 2, 2025

I've been using the plugin for years but I have never been sure how to properly match a user agent. The use case is almost always that I just want to ignore 404s from specific crawlers. However, my attempts never work as expected.

If I want to ignore ALL 404s from this user agent (taken from my 404 list), for example:

Mozilla/5.0 (compatible; MojeekBot/0.11; +https://www.mojeek.com/bot.html)

I put a regex in the URL that matches everything:

.*

But what do I put in User Agent? Is the Redirect matching against the whole UA string or is "Mozilla/5.0" the only part Redirection looks at? Do I actually need a pretty complex regex that matches most of the string and accounts for version number changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant