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

404 error not found since 1.1.4 #23

Closed
francoislevesque opened this issue Oct 6, 2021 · 4 comments
Closed

404 error not found since 1.1.4 #23

francoislevesque opened this issue Oct 6, 2021 · 4 comments

Comments

@francoislevesque
Copy link

We have a multiple site configuration using only one root index.php (directly in the web directory). Since updating to 1.1.4, the csrfToken request returns a 404 error.

http://arto-galleria.test/en/index.php?p=actions/users/session-info&dontExtendSession=1 returns 404 since there's no /en/index.php file.

These URLs are working however:

http://arto-galleria.test/index.php?p=actions/users/session-info&dontExtendSession=1
http://arto-galleria.test/actions/users/session-info?dontExtendSession=1
http://arto-galleria.test/en/actions/users/session-info?dontExtendSession=1

I propose using :
{{currentSite.baseUrl}}/{{ craft.app.config.general.cpTrigger }}/{{ craft.app.config.general.actionTrigger }}/users/session-info?dontExtendSession=1

Instead of
{{currentSite.baseUrl}}index.php?p={{ craft.app.config.general.cpTrigger }}/{{ craft.app.config.general.actionTrigger }}/users/session-info&dontExtendSession=1

@clarknelson
Copy link
Owner

clarknelson commented Oct 7, 2021

I'm guessing that index.php isn't in the web root? Maybe we can find a twig variable to reference that file. I'm pretty sure someone asked for the index.php variable explicitly. Sorry you are having issues.

Does /en/index.php?p=actions/users/session-info&dontExtendSession=1 work? Maybe we should add support for multi-site?

@francoislevesque
Copy link
Author

Hi Clark!

We use the standard Craft directory structure:

assets/
config/
cpressources/
migrations/
storage/
templates/
translations/
web/
 ├── index.php
 ├── .htaccess
 ├── ...

All these URLs work:

http://arto-galleria.test/index.php?p=actions/users/session-info&dontExtendSession=1
http://arto-galleria.test/actions/users/session-info?dontExtendSession=1
http://arto-galleria.test/en/actions/users/session-info?dontExtendSession=1
/index.php?p=actions/users/session-info&dontExtendSession=1
/actions/users/session-info?dontExtendSession=1
/en/actions/users/session-info?dontExtendSession=1

This URL doesn't work:

http://arto-galleria.test/en/index.php?p=actions/users/session-info&dontExtendSession=1

It returns a 404 error since /web/en/index.php does not exists (index.php is in /web/index.php).

For the majority of users using multi sites, I believe the current way the URL is generated won't work. It may only works if this website is configured like this: https://craftcms.stackexchange.com/a/23764.

I believe this is what @desaulniers13 did, and why he had problems in the first place.

@desaulniers13 Can you confirm, and try this version of the code and see if it works with your configuration?

{{currentSite.baseUrl}}/{{ craft.app.config.general.cpTrigger }}/{{ craft.app.config.general.actionTrigger }}/users/session-info?dontExtendSession=1

@clarknelson
Copy link
Owner

Can you pull down v1.1.5 and see if it fixes for your multi site configuration? I believe since everyone has different {{currentSite.baseUrl}} values that was the issue. I changed the start of the path to /?p={{ craft.app.config.general.cpTrigger }}/... which I believe will work in more instances.

@clarknelson
Copy link
Owner

please respond if still an issue

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

2 participants