Skip to content
New issue

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

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

Already on GitHub? # to your account

No possibility to configure whether or not to remove index.html from the URL when adding to pushState #1427

Closed
mfranzke opened this issue Feb 10, 2022 · 1 comment · Fixed by #1428

Comments

@mfranzke
Copy link
Contributor

mfranzke commented Feb 10, 2022

inspired by and adapted from pattern-lab/styleguidekit-assets-default#49

We had a few issues, where:

  • Refreshing any page resulted in a 404 Page not found, either manually or after running php core/console --generate and reloading (we have a gulp task that watches for any changes in patterns, runs that command, and reloads the browser).
  • We couldn't share links between the team, since they returned 404s as well.

We found that the cause was that Pattern Lab removes index.html from the URL, and our hosting environment doesn't load index.html by default.
Our fix is to not remove index.html. If accepted, it wouldn't cause problems for anybody else and it would help PL to not assume the servers are configured to serve index.html as the default file.

I am using Pattern Lab Node v5.16.2 on Mac, with Node v12..13.1, using a Vanilla Edition.

Expected Behavior

Be able to decide in whether my system redirects from /index.html? to /? (comparable to SPA) or not, as I might host it in an environment, which doesn't handle the default document of index.html correctly, like e.g. Gitlab Pages (it's in their backlog to support SPA properly, but it's resulting in a problem at the moment at least after a reload).

Actual Behavior

A URL containing the file index.html is always being redirected to the equal one with index.html being removed.

Steps to Reproduce

You need to reproduce this on an environment that doesn't handle the default file of index.html correctly in case of that no file is being provided at the URL. Most it works perfectly correctly on your localhost (http://localhost:3000/?p=all) and on our preview environment on Netlify.

@mfranzke mfranzke self-assigned this Feb 10, 2022
mfranzke added a commit to mfranzke/patternlab-node that referenced this issue Feb 10, 2022
JosefBredereck pushed a commit that referenced this issue Sep 21, 2022
* refactor: providing the configurability for whether to remove index.html from the URL #1427

* docs(configuration): added entry for noIndexHtmlremoval
@JosefBredereck
Copy link
Contributor

Issue was released with v5.16.3

antonia-rose pushed a commit to quelltexterin/nemo-uikit-workshop that referenced this issue Apr 12, 2023
…#1428)

* refactor: providing the configurability for whether to remove index.html from the URL pattern-lab#1427

* docs(configuration): added entry for noIndexHtmlremoval
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants