A URL load a wrong page while in the backend the page is correct
-
Hi,
I’m having problems with the page https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/The link shows a wrong page, I mean this one https://ronb33.sg-host.com/de/schweisrauchabsaugung/
In the backend the page filter shows the right content and if I deactivate Permalink Manager the problem disappear.
I can’t understand how to solve this problem.
Thanks
The page I need help with: [log in to see the link]
-
Hi @ericafontimedia,
Ok, I got it, please correct me if I am wrong. If the /filter/ URL now leads to the same 404 page in both cases, it indicates the initial problem (reported in the first post) has been fixed.
I can only assist addressing any issues that occur when the plugin is active and do not appear when the plugin is deactivated.
Best regards,
MaciejHi, what do you mean with “leads to the same 404 page in both cases”?
The pages load correctly with the plugin activated with the exception of /de/filter.
It started to give 404 error after your last advice.
And also, as I said, with the deactivation of the plugin almost all the pages give 404 error, so it is not a correlation with the problem with that specific case.
Hi, what do you mean with “leads to the same 404 page in both cases”?
I mean that that the specific URL displays exactly the same 404 error page both: when the plugin is activated or deactivated.
https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/The pages load correctly with the plugin activated with the exception of /de/filter.
I think we have some misunderstanding here, because I am still not sure what you mean. Please let me know how this works when the plugin is deactivated and how this should work when the plugin is activated.
And also, as I said, with the deactivation of the plugin almost all the pages give 404 error, so it is not a correlation with the problem with that specific case.
This is how it works, because my plugin not only generates & saves the custom permalinks, but also includes a function that detects them. In other words, if the plugin is disabled, the “detect function” is not active, so some of the pages (if their custom permalinks were different than native permalinks) will give 404 error.
The built-in WordPress permalink functionality is limited to simple URL formats based on rewrite rules, making it necessary to use extra plugins for more complex URL setups.
I think we have some misunderstanding here, because I am still not sure what you mean. Please let me know how this works when the plugin is deactivated and how this should work when the plugin is activated.
I mean that all the pages of the website load correctly with the plugin activated, except this one.
I’m focusing on this statement because you said that both pages showed 404 error after the deactivation of the plugin, but as your are saying, this is how the plugin works, so it’s normal that both load 404 error when deactivated, right?
So it is saying nothing new to us, I suppose.Instead, when the plugin is active, the problem has not been fixed but only changed: instead of open the wrong page, the page give 404 error.
Yes, that is normal given that the widow “filter” endpoint should not display any content if used as a last segment of URL. Therefore, WordPress natively displays “hard 404 error” to prevent duplicate content SEO issue.
Based on the initial comment, I assumed you wanted to have that exact URL behave the same as if the plugin was turned off. And this is how it actually works in the end and IMHO technically it is no longer a problem, as long as that URL does not have any backlinks and is not indexed by Google or other search engines.
To be more specific, the code snippet that I sent you makes Permalink Manager ignore all the URLs that end with “/filter/” endpoint.
If “the problem has not been fixed, but only changed”, what other solution would you suggest in this situation?
- This reply was modified 2 weeks, 4 days ago by Maciej Bis.
No I didn’t say I wanted the page to work like the plugin was disabled, I said that the problem is that the link https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/ opens a wrong page, the same as https://ronb33.sg-host.com/de/schweisrauchabsaugung/ when they are in backend two completely different pages.
So I want it to open the right page, while the plugin is active.
- This reply was modified 2 weeks, 4 days ago by ericafontimedia.
- This reply was modified 2 weeks, 4 days ago by ericafontimedia.
To add information: with the plugin deactivated, the link https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/ doesn’t work because the link become https://ronb33.sg-host.com/de/?categoria=schweisrauchabsaugung-filter
By deactivating the plugin and using this link the page is visible and works perfectly.
But I’ve installed your plugin because this is not the URL structure I want. The URL https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/ is perfect but for some reason it doesn’t work.
So my request is not to have the same result I have by deactivating the plugin, because https://ronb33.sg-host.com/de/?categoria=schweisrauchabsaugung-filter is not the link I want.
I ask you to help me to understand why with your plugin this page with this link doesn’t work and help me to solve it.
I hope I have clarified the situation!
Yes, I think I got it now – please replace the first snippet with the new one:
function pm_ignore_filter_endpoint( $uri_parts, $request_url, $endpoints ) {
if ( ! empty( $uri_parts['endpoint'] ) && $uri_parts['endpoint'] == 'filter' && empty( $uri_parts['endpoint_value'] ) ) {
$uri_parts['uri'] .= "/filter";
$uri_parts['endpoint'] = "";
}
return $uri_parts;
}
add_filter( 'permalink_manager_detect_uri', 'pm_ignore_filter_endpoint', 100, 3 );Just put it but it seems not working!
Hmm, I tested it with both WPCode & functions.php and it worked correctly.
Could you send me once again the screen with the snippet contents + the snippet settings (if you use WPCode to add it)?
Sure, here you are!
Thanks, please make sure that the code snippet is activated:
I don’t know why it was deactivated, sorry!
Wonderful! Now finally it works!!
- This reply was modified 2 weeks, 4 days ago by ericafontimedia.
Excellent, I am glad it works now and sorry that it took so long!
Oh no, now I have the same problem with all the products present in the page https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/
For exampe: https://ronb33.sg-host.com/de/schweisrauchabsaugung/filter/sfc/ they still open https://ronb33.sg-host.com/de/schweisrauchabsaugung/
- You must be logged in to reply to this topic.