Wordpress gives error 404 when I change the permalink of pages and posts

Wordpress gives error 404 when I change the permalink of pages and posts. It only works with the standard permalink.

[image]

Welcome @Rodolfosilvajose Happy you are here

This is an issue unrelated to CyberPanel however he is what you try:

  1. Change your .htaccess because it might be a .htaccess misconfiguration
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Also restore the permissions of your .htaccess file to 0644

  1. Plugins might cause this. Try disable all plugins and try again

  2. Disable modsecurity and try again (last resort)

  3. Disable cache plugin or clear cache from the plugin’s settings

Restart LiteSpeed via SSH

sudo systemctl restart lsws

It worked for me.
I did this everytime the wordpress generate new .htaccess (usually after very first time permalink change)

1 Like