-
Notifications
You must be signed in to change notification settings - Fork 50
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
CLI install creates wrong rewrite rules which prevent the .htaccess
from being created
#106
Comments
I cannot replicate this on my system. WP-CLI basically just calls the WordPress I'd guess that your cli/server environment is set up in such a way the WordPress' Can you provide more information about your server environment? |
Darn it, I feared this is something environment specific. I'm running on Windows WSL, Ubuntu 16.04. I tried setting the |
@eyalroth See wp rewrite flush documentation regarding needed entries in WP-CLI config files and check what is returned by |
@wojsmol I'm getting |
@eyalroth This shoud be |
@wojsmol Installation is done via composer: {
"type" : "project",
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"php": ">=7.0",
"composer/installers": "1.*",
"johnpbloch/wordpress": "5.1.*"
},
"extra": {
"wordpress-install-dir": "public/wp",
"installer-paths": {
"public/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
"public/wp-content/themes/{$name}/": ["type:wordpress-theme"]
}
}
} |
I did a bit of digging. The rewrite rules are built with this |
@eyalroth This page might help diagnose the actual issue: https://docs.bolt.cm/3.6/howto/making-sure-htaccess-works |
@schlessera Most of the page is concerned with an existing |
Summary
Installing WP via
wp core install
creates rewrite rules withindex.php
as prefix, which then causes the.htaccess
file never to be written, even not bywp rewrite flush --hard
. The installation process viawp-admin
produces a different set of rules which does not cause this problem.Here's the output of
wp rewrite list
after an installation withwp core install
:cli-rewrite.txt
And here's the output for the same command after an installation via
wp-admin
:manual-rewrite.txt
Workaround
Set a custom rewrite structure, such as
wp rewrite structure '/%category%/%postname%/' --hard
to (a) correct the rewrite rules and (b) force the writing of the.htaccess
file.The text was updated successfully, but these errors were encountered: