-
-
Notifications
You must be signed in to change notification settings - Fork 607
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 Behaviour needs looking at. Requests returning 301. #316
Comments
ty for success case 💯 |
Seen this before. I believe it is due to how Nginx rewrite are made. Changing the Wordpress permalink setting to "post" make it work correctly. |
@louim yep. That fixes it. https://codex.wordpress.org/Nginx#URL_Rewrites_.2F_Permalinks So the question is: do we care? |
Perhaps we could add a WP-CLI command to set the site to pretty permalinks by default. I mean, who doesn't turn those on anyways? |
seems like permalinks should be enabled by default as of 4.2: https://core.trac.wordpress.org/ticket/6481 |
I'm betting it's because WP is installed with wp-cli. I would assume that installing WP via the 5-minute installer would have pretty permalinks enabled. Man, it's been a while since I did it that way 😂 |
@kalenjohnson I don't believe it makes a difference, or maybe the wp-cli has some hack to install without using the install method of WordPress? This is the function used to check if permalinks can be enabled: https://developer.wordpress.org/reference/functions/wp_install_maybe_enable_pretty_permalinks/ |
@louim yep I've been looking at it. I'm not sure if the permalink testing works from the command line though... could be completely off base, that was just my assumption. I'm also going off memory, but I'm pretty sure in the last few months, definitely post-4.2 release, I've had to enable pretty permalinks on a Trellis site. Should probably just give it a try again though to confirm. |
Fix #316 - Add wp-cli permalink command
This resolves roots#316 by adding wp-cli permalink commands to check and then set the rewrite rules when none are set Conflicts: group_vars/development/wordpress_sites.yml group_vars/production/wordpress_sites.yml group_vars/staging/wordpress_sites.yml
Bare trells + bedrock master is giving me weird 404 behavior. It's returning 301 Moved Permanently for stuff that should return a 404.
For posterity:
trellis commit 8a84639
bedrock commit https://github.com/roots/bedrock/tree/5dc485e1058e3a32c218e8d90c9abb5929f16cd4
run the test
Reduced testcase: https://gist.github.com/austinpray/d067346e447910f9d70a
You can run the tests by cloning the gist:
You can cleanup by running:
results
full output
edit: added a success case
curl http://example.dev/
to show that the setup is working in the first place.The text was updated successfully, but these errors were encountered: