the plugin has an issue where when navigating to a ticket page on the frontend (for example, going to Client Area -> Support -> Clicking on Ticket) results in a 404 Page not found error, instead of showing ticket.
Example link structure to where error happens:
https://yoursite.net/ticket/67856/#reply-73755
This makes impossible for customers to open, view or reply tickets, destroying the plugin functionality.
Upon debugging the issue, it seems that going to WordPress Settings -> Permalinks -> Save Permalinks temporarily solves the issue.
However, after about 1-2 days from permalink reset and for unknown circumstances, the 404 error comes back everytime, until I save permalinks again.
I would greatly appreciate a solution to the issue or help pointing to a fix.
I already tried deactivating all the other active plugins, and the issue persists.
Thank you and best regards
]]>We have an issue where the rewrite rules are broken. On calling the WordPress Rewrite (Admin > Permalinks > Save). There is a ‘rogue rule’ that breaks a call to certain pages on our site. Running the Polylang rewrite (Languages> Settings > URL Modifications > Save) cures this.
(Polylang settings are “The language is set from content” and “Remove /language/ in pretty permalinks”
We are currently trying to track down the mechanism that calls the WordPress Rewrite but not the Polylang but I am looking for some insight from Polylang as how to ensure that if the WordPress function flush_rewrite_rules()
is called the Polylang ‘extra’ is also called.
I use the following URL layout in Polylang:
The language is set from the directory name in pretty permalinks
Hide URL language information for default language
Remove /language/ in pretty permalinks
So in other words, my default language (EN) blog posts will be at example.com/hello-world/
and other (e.g. DE) blog posts will be at example.com/de/hallo-welt/
.
This used to work fine in the past, but I don’t know what’s different on this site, so I figured in addition to debugging myself I’m gonna seek help here as well.
The problem is now when I visit example.com/hello-world/
, WordPress matches the ([^/]+)/?$ -> lang=$matches[1]
rewrite rule, when in fact it should match (.?.+?)(?:/([0-9]+))?/?$ -> pagename=$matches[1]
&page=$matches[2]
You can see this on these screenshots with Query Monitor:
Bad:
Good:
See the difference in rewrite rules.
Some additional information:
There’s something that can be made to TAX rewrite rules be higher on rules sequence??? if ‘documentos/tipo/([^/]+)/?$’ be on top, WP will use it before ‘documentos/([^/]+)(?:/[0-9]+))?/?$
Thanks for the help
]]>I’m running a WordPress site with WooCommerce and in order to improve performance, I’ve written a MU plugin that unloads the WooCommerce plugin on non-WooCommerce pages.
The problem I’m running into is that after some amount of time (on the order of a couple times per day), the permalinks to my WooCommerce products “disappear.”
I can fix this (regenerate the WooCommerce permalinks/rewrite rules) by navigating to the WP Permalinks page and clicking the Save Permalinks button. Unfortunately, that only works for half a day or so.
I assume this happens because (another plugin?) makes a call to flush_rewrite_rules() at some point, and because I’ve explicitly unloaded the WooCommerce Plugin, it is not registered to update its rules, thus resulting in no rules for anything under /product/.
So, a couple questions:
Thanks,
Dan
My product urls are structured like this: example.com/products/category/productslug/ Now if I go to a product and change the url to something like this: example.com/products/cate/productslug/ Please note that it could be any variations where the category is changed aslong as there is one letter in the category part of the url. Then it will not give me a 404 error or redirect me to the normal url. In other words I will still be on the product page but the url will stay as it’s typed.
Changing /products/ or /productslug/ will give me a 404 error.
If I go to a normal post and do the same thing (they are structered like this: /category/postslug/) then I will be redirected to the right url. So for example changing example.com/news/postslug/ to example.com/n/postslug/ I will be redirected to the original url.
I’ve been working a long time with wordpress and woocommerce and have never noticed this behavior before and I’m not sure if it’s intended to be like this or if something is wrong with my rewrite rules.
Any clarification about this would be greatly appreciated.
Thanks in advance!
]]>I’d like to keep the same slug /hilfe-chat/
for both CPT and Taxonomy archives, which seems to generate a conflict (404 for Taxonomy archives).
CPT
$rewrite = array(
'slug' => 'hilfe-chat',
'has_archive' => 'hilfe-chat',
Custom taxonomy
$args = array(
'rewrite' => array('slug' => 'hilfe-chat')
);
Rewrite rules for custom taxonomy
/** Rewrite rule to handle third level slug */
function chat_cpt_generating_rule($wp_rewrite) {
$rules = array();
$terms = get_terms( array(
'taxonomy' => 'wg_chat_category',
'hide_empty' => false,
) );
$post_type = 'wg_seo_chat';
foreach ($terms as $term) {
$rules['hilfe-chat/' . $term->slug . '/([^/]*)$'] = 'index.php?post_type=' . $post_type. '&wg_seo_chat=$matches[1]&name=$matches[1]';
}
// merge with global rules
$wp_rewrite->rules = $rules + $wp_rewrite->rules;
}
add_filter('generate_rewrite_rules', 'chat_cpt_generating_rule');
/** Inject the chat category into the CPT Link */
function change_link( $permalink, $post ) {
if( $post->post_type == 'wg_seo_chat' ) {
$chat_terms = get_the_terms( $post, 'wg_chat_category' );
$term_slug = '';
if( ! empty( $chat_terms ) ) {
foreach ( $chat_terms as $term ) {
// The featured chat will have another category which is the main one
if( $term->slug == 'featured' ) {
continue;
}
$term_slug = $term->slug;
break;
}
}
$permalink = get_home_url() ."/hilfe-chat/" . $term_slug . '/' . $post->post_name;
}
return $permalink;
}
add_filter('post_type_link',"change_link",10,2);
Any thoughts on how to resolve this conflict are much appreciated.
Thanks, Jan
]]>sendinblue_woocommerce_rewrites
in file woocommerce-sendinblue.php
on line 146, the rewrite rule is added inside an array, which is not valid.
Instead of:
$wp_rules[] = array(
"sendinblue-callback\$" => 'index.php?pagename=sendinblue-callback'
);
write this:
$wp_rules[ 'sendinblue-callback\$' ] = 'index.php?pagename=sendinblue-callback';
I would like to ask devs – where I can find full list of endpoints for ajax requests like domain.com/?wc-ajax=… where url is exactly homepage
I’m struggling with .htaccess rewrite rules to rewrite only homepage and I need to check query params like this:
—
RewriteCond %{QUERY_STRING} !wc-ajax
RewriteRule ^$ /index_custom.html [NC,L]
—
Can I be safe if I check only wc-ajax substring? Or I need to add something else?
Thanks a lot,
Ragnar