I have a new wordpress installation and I wrote some rewrite rule in my functions.php that looks like this:
// "rewrite" /assets/xyz to /assets/?asset=xyz function assets_rewrite_rule($rules) { global $wp_rewrite; $asset_rule = array( // (not tested) 'assets/(.+)/?' => 'index.php?pagename=Assets&asset=$matches[1]' ); return array_merge($asset_rule, $rules); } add_filter('page_rewrite_rules', 'assets_rewrite_rules');
And I have a sidebar translated using WPML and String Translation in the most primitive way.
Here's the English part (not translated) of my sidebar -
<div class="sideall"> <div class="sidebar-mai1"> <div class="sidebar-name"> <img style="width: 25px; margin-right: 10px; margin-bottom: -7px;" title="first asset" src="/wp-content/images/sidbar-assets/firstasset.png" alt="first asset" />First Asset</div> <div class="sidebar-btn"> <a class="btn-sidebar" href="/assets/first-asset/">Review</a> <a class="btn-sidebar1" href="/buy/first-asset">Trade Now!</a></div> <div style="clear: both;"></div> </div>
And, trying to translate into another language (say, Italian), wpml refuses to save my changes in the review links ... since my redirection rule somehow affects it.
Here's the translation I added to the sidebar -
<div class="sideall"> <div class="sidebar-mai1"> <div class="sidebar-name"> <img style="width: 25px; margin-right: 10px; margin-bottom: -7px;" title="first asset" src="/wp-content/images/sidbar-assets/firstasset.png" alt="first asset" />First Asset</div> <div class="sidebar-btn"> <a class="btn-sidebar" href="/it/assets/first-asset/">Revisione</a> <a class="btn-sidebar1" href="/buy-it/first-asset">Scambia ora!</a></div> <div style="clear: both;"></div> </div>
As you can see, the review and buy links have been changed. But after I clicked the "Save" button, it only saves the changes made to buy href, but it changes my change to a review link, and it looks like after saving -
<div class="sideall"> <div class="sidebar-mai1"> <div class="sidebar-name"> <img style="width: 25px; margin-right: 10px; margin-bottom: -7px;" title="first asset" src="/wp-content/images/sidbar-assets/firstasset.png" alt="first asset" />First Asset</div> <div class="sidebar-btn"> <a class="btn-sidebar" href="/it/assets">Revisione</a> <a class="btn-sidebar1" href="/buy-it/first-asset">Scambia ora!</a></div> <div style="clear: both;"></div> </div>
As you can see, after I clicked on the “Save” button, it removes the / first -asset part from my translation, and now this leads to an empty page (/ it / assets). I am wondering if this could be the reason as a result of the rewriting ..