Permalinks by page/post name returning 404
I was able to find the answer here: I had to create a custom permalink with the following value: /index.php/%postname%/
I was able to find the answer here: I had to create a custom permalink with the following value: /index.php/%postname%/
I found that by removing the WordPress section from the .htaccess in the main website root, both main website custom 404 and WordPress custom 404 functionality appear to work correctly. Is there any reason why I shouldn’t do this? Yes, this is what I was going to suggest. If WordPress is installed in the subdirectory … Read more
Why it happens The error 404 on the th/<page slug> pages occurs because your custom rewrite rules overwrite the default Page rules which would otherwise load the correct Page (having the slug <page slug>). How to fix the issue If your permalink structure is /%postname%, i.e. example.com/<post slug>, then a simple fix to the error … Read more
I just had a problem like this. Did you change the salts in wp-config by any chance? I changed them mid-production and the whole back-end just went haywire. If you have a snapshot of an older wp-config, try that!
As MrWhite mentioned above, mod_rewrite was not enabled on the new server. Enabled that and all is working fine now. Thanks for your help 🙂
Every URL that has example.com/<non-existent-page> redirects to the main page: example.com/es/. This is presumably being done by WordPress itself, as there is nothing in what you’ve posted (in .htaccess) that is doing this. You probably need to add an additional “wildcard” redirect to redirect /<anything> (except for /es and /en) to /es/<anything>. For example: RewriteCond … Read more
This answer was based off the comment from @Rup on the question. I needed to add a .htaccess file to my source. I did this with the default contents: # BEGIN WordPress RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # … Read more
Check the referring URL and the user agent. Usually these are caused by robots that found a link to the draft or happened to be scanning your site while you were previewing the posts. I wouldn’t worry about it unless it was an actual user that was getting the error.
I am answering my own question so others can find it in the future. defining NOBLOGREDIRECT in wp-config.php to point to the url of your choice will correct this problem. Sample: define(‘NOBLOGREDIRECT’, ‘http://www.my-domain.com’);
Posting as an answer from the @OneTrickPony comment above: Verify that mod_rewrite is enabled on your server. Assuming that mod_rewrite is enabled, ensure that the root WordPress install directory is WordPress-writeable, or that, if it exists, the .htaccess file in the root WordPress install directory is WordPress-writeable. (See file permission scheme for WordPress, and Hardening … Read more