-
AuthorPosts
-
November 25, 2019 at 2:48 pm #1159870
update: this may have been a server config issue. nginx does not seem to process (missing) static files (on WPEngine at least) through the WP 404 page, so extra rules need adding to point to the custom 404 page
in trying to fix the nginx 404 showing for 4.6 the WPEngine team had added
proxy_intercept_errors = on;
however this is not requiredthese lines however are apparently required on WPEngine in the nginx config
error_page 404 =404 /404-2/;
// (URL of 404 page on our site is /404-2)
error_page 403 =403 /404-2/;
—
There seems to be an issue with the 404 implementation in Enfold 4.6.3.1 compared to 4.4.1
In order to register 404s for file types (eg .pdf, .txt etc) we need to add an entry into WPEngine’s nginx config
error_page 404 =404 /404-2/;
(my 404 page url is
/404-2
)this works with Enfold 4.4.1’s 404 custom page settings.
When I go to
example.com/this-is-not-a-page
, I get my custom 404 page
When I go toexample.com/this-is-not-a-file.pdf
, I get my custom 404 pagehowever in Enfold 4.6.3.1 have to disable the custom 404 Enfold setting, otherwise I just get an nginx 404 error instead of my custom wordpress page.
Both versions should behave the same
Also in Enfold 4.6.x a bad login at
/wp-login.php
also leads me to an nginx 404 page rather than back to the login page with a validation error.
In Enfold 4.4.x it leads me to my custom 404 pageboth should presumably take me back to
/wp-login.php
and show me an error- This topic was modified 4 years, 12 months ago by codemonkeynorth.
November 27, 2019 at 10:35 pm #1160815Hey codemonkeynorth,
Unfortunately not a lot we can do to help with this as it is a configuration issue and our knowledge is a little bit limited.
Best regards,
BasilisNovember 27, 2019 at 10:39 pm #1160817Hi,
yes sorry I think in this case you are right. It was a coincidence that 4.4 and 4.6 were (not) working differently in that the nginx configs on the servers were also different.
I read you’d changed the 404 handling in 4.6 from another issue thread, which is why I thought there was an issue at the Enfold end.
note to anyone coming to this thread though: we had to set an nginx rule for static files pointing to our custom 404 (eg mysite.com/this-doesnt-exist.pdf), and then let WP/Enfold custom 404 setting deal with dynamic pages
thanks
JNovember 29, 2019 at 11:31 pm #1161400Hi,
Thank you for sharing all those details, we do appreciate that a lot.Best regards,
BasilisNovember 30, 2019 at 6:46 am #1161434For anyone interested here’s the full rule in place on nginx that covers http->https and static file custom 404’s (note our 404 page slug is
404-2
)
WPEngine tech staff created it but if anyone has any better suggestions please let me knowset $if_https 0; if ( $http_x_forwarded_proto != "https" ) { set $if_https 1; } set $if_content_includes 0; if ( $uri ~* "/wp-content|wp-includes|\.*" ) { set $if_content_includes 1; } set $force_assets "$if_https:$if_content_includes"; if ( $force_assets = "1:1" ) { rewrite ^/ https://$host$uri? permanent; } error_page 404 =404 /404-2/; error_page 403 =403 /404-2/;
- This reply was modified 4 years, 11 months ago by codemonkeynorth.
December 2, 2019 at 6:14 am #1161739 -
AuthorPosts
- You must be logged in to reply to this topic.