-
Notifications
You must be signed in to change notification settings - Fork 759
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
Handle basePath without trailing slash #1344
Conversation
Do you meant that you don't want an |
Let's say I am using react-static to host a blog on my website which is on the domain If a user visits my blog at |
I understand now! You're saying that without a trailing slash it won't
work properly.
…On 2019-12-19 19:31, Shazz Amin wrote:
>> However, the regular expression we use doesn't catch /blog, only
>> /blog/*.
>
> Do you meant that you don't want an index page by react-static? I
> don't _quite_ understand what the issue is 😓
Let's say I am using react-static to host a blog on my website which
is on the domain example.com. I want my blog to be available at
example.com/blog. So, in react-static's configuration, I set basePath
to be blog.
If a user visits my blog at example.com/blog, react-static should
internally rewrite the /blog to / and serve the user whatever is at
that route. The problem is that the rewrite function does not
currently rewrite /blog to / (see this test [1]). It does rewrite
blog, blog/ and /blog/ to / (see the rest of the tests in that diff).
This looks like a bug to me. Let me know if I've misunderstood
something and/or if this behaviour is intentional.
--
You are receiving this because you commented.
Reply to this email directly, view it on GitHub [2], or unsubscribe
[3].
Links:
------
[1]
https://github.com/react-static/react-static/pull/1344/files#diff-ffb4c6d68c82756a31dabf967e57fd29R55-R57
[2]
#1344?email_source=notifications&email_token=AAO7SWAXFW4EKEAB2CEDYM3QZMWNBA5CNFSM4JRTCWBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHI23HQ#issuecomment-567389598
[3]
https://github.com/notifications/unsubscribe-auth/AAO7SWH2DM27IIH4SV7FJ4DQZMWNBANCNFSM4JRTCWBA
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just get this merged and see if there are reports coming in.
Description
The documentation states that the
basePath
configuration can be used to host a site at a specified path, e.g.https://mysite.com/blog
. However, the regular expression we use doesn't catch/blog
, only/blog/*
.Changes/Tasks
/{basePath}
resolve to/
when determining the route path.Motivation and Context
Allows sites hosted at a particular path to function as expected and as described in existing documentation.
Types of changes
Checklist: