Resets WordPress' rewrite rules based on registered post types, etc.
To regenerate a .htaccess file with WP-CLI, you'll need to add the mod_rewrite module
to your wp-cli.yml or config.yml. For example:
apache_modules:
- mod_rewrite
## OPTIONS
[--hard]
: Perform a hard flush - update .htaccess rules as well as rewrite rules in database. Works only on single site installs.
## EXAMPLES
$ wp rewrite flush
Success: Rewrite rules flushed.
Sets the post permalink structure to the specified pattern.
To regenerate a .htaccess file with WP-CLI, you'll need to add
the mod_rewrite module to your WP-CLI config.
For example:
apache_modules:
- mod_rewrite
## OPTIONS
: The new permalink structure to apply.
[--category-base=]
: Set the base for category permalinks, i.e. '/category/'.
[--tag-base=]
: Set the base for tag permalinks, i.e. '/tag/'.
[--hard]
: Perform a hard flush - update .htaccess rules as well as rewrite rules in database.
## EXAMPLES
$ wp rewrite structure '/%year%/%monthnum%/%postname%'
Success: Rewrite structure set.