This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.


This topic contains 5 replies, has 2 voices.

Last updated by Carlos Rojas 1 year, 3 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
January 21, 2019 at 10:33 pm #3114263


Hi, I have 2 languages : french and english, french is my default.

I have created a custom rewrite rule for one page named "Fiche" like this :

$aNewRules = array('location-maisons-villas-piscine-sud-france([^/]+)/([^/]+)$' => 'index.php?pagename=fiche&ref=$matches[2]');
$aRules = $aNewRules + $aRules;
return $aRules;
add_filter('rewrite_rules_array', 'add_rewrite_rules');

It's working well in french, but when I want to switch in english, the URL of the link if hidden link so URL rewriting is not working, and parameters aren't passed...

How can I make it work ?

January 22, 2019 at 3:35 pm #3117250

Carlos Rojas

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you for contacting WPML support.

1.- I'm sorry but I don't understand what do you want to achieve? Could you explain what should be the result of the changes in the URL?

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb:
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,

February 7, 2019 at 4:37 pm #3171484


Thanks to our custom permalinks, the URL like this : hidden link are replaced by nice URLs like this : hidden link.
The rewrite rules work well with the default language which is french, but if I'm on this URL : hidden link and I click the flag to translate in english, I'm not redirected to : hidden link like I want, but to : hidden link

The rewrite rule is not followed and the parameter xxxxxx is not passed.

Hope it's clearer 🙂 Thanks.

February 7, 2019 at 10:36 pm #3172486

Carlos Rojas

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,
Thank you very much for your feedback.

if I understood correctly you need to preserve the parameter 'xxxxx', if this is the case then you need to follow this steps: WPML -> Languages -> Language switcher options -> Preserve URL arguments -> Add the variable name.

Could you tell me if the steps above solved the issue?


February 13, 2019 at 12:44 pm #3193978


No I'm sorry it's not working.
You can see the issue here : hidden link

As you can see, the URL rewriting is working fine.
Now look if you hover the english flag on the header. The english URL is not : hidden link but hidden link and so it's not working.

I'm expecting the URL to be the same as the french one, except the en parameter.

February 14, 2019 at 12:17 pm #3199491

Carlos Rojas

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)


It seems -unfortunately- that for now you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:

Before doing so please have a look also here:

You will get the custom assistance you need to get on with your project.