-
Notifications
You must be signed in to change notification settings - Fork 9
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
Check for redirects? #20
Comments
That's a good idea. I'd still not recommend linking to a resource you know for certain is a permanent redirect, but the plugin certainly shouldn't flag it as non-existing |
Exactly. It stopped my build from deploying, I had to fix some really old links (good practice as you say), but don't think it should stop it from deploying in this specific case. |
I looked a bit into what code is available from netlify to extract that information. It's not a setup I'd like to depend on it its current form. But eventually there will be utilities to provide the data set for this feature. Blocked, waiting for netlify/build#217 |
I'm running into the same problem. The index page for my site is a redirect to a concrete "home" page. For various reasons, this can't be an HTML file. However, every page links to it (from the header). As a result the checklinks plugin reports it as a failure. I'd be fine if I could supply a list of these locations that would be added to the set of available HTML files that hyperlink checks (sort of the inverse of skip patterns). For now, I touch the index.html file at the end of the build command, then make sure to use the force flag on my redirect rule so the file is ultimately ignored by the web server. |
It seems the netlify-redirect-parser is under active development; not sure whether that helps facilitate a resolution for this issue, but fingers crossed it does. I've said it before but this plugin is great; thanks. It's caught various typos etc. in the past and saved many 404s! To add my use case (if useful); I'm setting up a proxy for Plausible analytics - following their guide. The purpose for redirects, in this case, is to rewrite requests for My [build.processing.html]
pretty_urls = true
# [[plugins]]
# package = "netlify-plugin-checklinks"
#
# [plugins.inputs]
#
# # An array of glob patterns for pages on your site
# # Recursive traversal will start from these
# entryPoints = [
# "*.html",
# ]
#
# recursive = true
# Redirect default Netlify subdomain to primary domain
[[redirects]]
from = "https://mydomain.netlify.app/*"
to = "https://www.mydomain.com/:splat"
force = true
# Redirect for Plausible Analytics script
[[redirects]]
from = "/a/js/script.js"
to = "https://plausible.io/js/plausible.js"
status = 200
# Redirect for Plausible Analytics API calls
[[redirects]]
from = "/a/api/event"
to = "https://plausible.io/api/event"
status = 202 My <script defer data-domain="mydomain.com" data-api="/a/api/event" src="/a/js/script.js"></script> ... which is what the checklinks plugin catches and flags as an invalid URL (i.e. |
Hey,
Is it possible to look at Netlify redirects, as the plugin checks for some links that have 301 redirects on, but are marked as broken.
Great plugin!
Cheers.
The text was updated successfully, but these errors were encountered: