Skip to content

docs: .htaccess and lazy loaded routes (fix #2753) #2755

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

Merged
merged 2 commits into from
May 31, 2022
Merged

Conversation

xseignard
Copy link
Contributor

On apache we need to add more configuration to handle lazy loaded
routes. Updated docs in all available languages.

See Multiviews paragraph here: https://httpd.apache.org/docs/2.4/en/content-negotiation.html#negotiation

On apache we need to add more configuration to handle lazy loaded
routes. Updated docs in all available languages.
@posva posva added docs need review Needs to be reviewed by someone who know about the topic labels May 2, 2019
@posva
Copy link
Member

posva commented May 2, 2019

Thanks for this! I don't use Apache so I will wait for someone else review before merging

@phanan
Copy link
Member

phanan commented May 2, 2019

This looks good, but better yet, we should check for mod_negotiation's availability as well:

<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
# The rest of the config

@xseignard
Copy link
Contributor Author

Hi @phanan you're right. I'll update the PR.
In the meantime CRA don't bother that much, see the recommended Apache conf of their: https://facebook.github.io/create-react-app/docs/deployment#serving-apps-with-client-side-routing

The .htaccess config now checks if the `mod_negotiation` module exists
before trying to apply the MultiViews option. Updated for each available
language.
@posva
Copy link
Member

posva commented May 3, 2019

I think the other if was meant to be kept, wdyt @phanan ?

@hunsalz
Copy link

hunsalz commented May 31, 2022

Hey guys, I would appreciate if the PR from @phanan gets accepted. I had the same issue with a user of us and I had to search a while before I found this. I can imagine that a lot of users gave up frustrated before having a solution. Please take a look at this again and push it live! Thx in advance

@stsmdt
Copy link

stsmdt commented May 31, 2022

As mentioned by @hunsalz we simply used the current example configuration for Apache from the documentation and had issues with the lazy loaded routes then.

Adding Options -MultiViews to the configuration solved the problem then. This should be included in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs need review Needs to be reviewed by someone who know about the topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants