N
N
Nikita Danilov2016-10-17 09:00:33
Apache HTTP Server
Nikita Danilov, 2016-10-17 09:00:33

Wordpress without CNC. How to make a correct 404 response?

Good afternoon! There is a site on Wordpress 4.6.1, terraoko.com. (The web server is Apache 2.4, nginx is on the face, but 404s are processed by Apache according to the settings). It is impossible to enable "pretty permalinks" (CNC) due to the working conditions, the links are "non-human". This causes the following problems:
1) The 404 page does not work and the 404 code does not return in the right situations; the main page, for example:
terraoko.com/non-exist-url is transformed into terraoko.com/non-exist-url
The "ErrorDocument 404 /404.html" directive in .htaccess does not help (probably because everything goes to index.php), and the 404.php file of the theme also does not want to work when CNC links are turned off (although it works when they are turned on, but they are not allowed).
The mod_rewrite module is enabled, the option AllowOverride All for the site folder is also enabled.
2) None of the dynamic sitemap generating plugins provide a working link at /sitemap.xml. And it’s not clear how to create a static map, all new plugins for the new version of WP are focused on dynamic ...
Is it possible to somehow get out at least on the 1st point (and how realistic is it without turning on the CNC)?
PS. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2016-10-18
@NDanilov2015

If pretty permalinks are not used, the mod_rewrite module is not needed. WordPress will not parse the url, but only look at GET. Also, make sure there are no rewrite rules in .htaccess.
About 404:
ErrorDocument 404 /index.php?error=404

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question