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

local server: handling extensionless links #548

Open
domdomegg opened this issue May 23, 2023 · 0 comments
Open

local server: handling extensionless links #548

domdomegg opened this issue May 23, 2023 · 0 comments

Comments

@domdomegg
Copy link

A lot of people use links that look like /some-path on their sites. Under the hood, the web server maps this to the file some-path.html (e.g. like Vercel's cleanUrls option).

Unfortuantely, when running linkinator on a directory it doesn't figure these links out, and reports them as missing.

Is there a way to get something like this working with linkinator? I gave URL rewriting a go, but struggled to get it working with any of:

npx linkinator ./dist --url-rewrite-search 'dist/.*$' --url-rewrite-replace '$0.html'
npx linkinator ./dist --url-rewrite-search '(?<=dist/.*)$' --url-rewrite-replace '.html'
npx linkinator ./dist/index.html --url-rewrite-search '(?<=dist/.*)$' --url-rewrite-replace '.html'
npx linkinator ./dist/index --url-rewrite-search '(?<=dist/.*)$' --url-rewrite-replace '.html'
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